def METHOD_NAME(caption="", parent=None):
    """Show python exception in a modal dialog.
    Creates a modal dialog without any option other than dismising the
    exception information.  The exception traceback is displayed in a
    monospaced font and its text can be copied into the clipboard.
    This only works during the handling of an exception since it is
    not possible to retrieve the traceback after the handling.
    Args:
        caption (str): the dialog title.
        parent (wx.Window): parent window.
    """
    current_exception = sys.exc_info()[1]
    if current_exception is None:
        raise RuntimeError('Not handling an exception')
    ## wx.MessageDialog looks better than plain wx.Dialog but we want
    ## to include the traceback without line-wrapping and to be able
    ## to copy its text.  We can't easily reimplement wx.MessageDialog
    ## with this extras because wx.MessageDialog is not a simple
    ## subclass of wx.Dialog, it uses native widgets for simpler
    ## dialogs, such as gtk_message_dialog_new.
    dialog = wx.Dialog(parent, title=caption, name="exception-dialog",
                       style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
    message = wx.StaticText(dialog, label=str(current_exception))
    details = wx.TextCtrl(dialog, value=traceback.format_exc(),
                          style=(wx.TE_MULTILINE|wx.TE_DONTWRAP|wx.TE_READONLY))
    ## 'w.Font.Family = f' does not work because it 'w.Font' returns a
    ## copy of the font.  We need to modify that copy and assign back.
    details_font = details.Font
    details_font.Family = wx.FONTFAMILY_TELETYPE
    details.Font = details_font
    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(message, wx.SizerFlags(0).Expand().Border())
    sizer.Add(details, wx.SizerFlags(1).Expand().Border())
    sizer.Add(dialog.CreateSeparatedButtonSizer(wx.OK),
              wx.SizerFlags(0).Expand().Border())
    ## The default width of a TextCtrl does not take into account its
    ## actual content.  We need to manually set its size (issue #497)
    if (wx.Platform != '__WXMSW__') and (wx.Platform != '__WXMAC__'):
        details_text_size = details.GetTextExtent(details.Value)
    else:
        ## On Windows and Mac, GetTextExtent ignores newlines so we
        ## need to manually compute the text extent.
        traceback_lines = details.Value.splitlines()
        longest_line = max(traceback_lines, key=len)
        one_line_size = details.GetTextExtent(longest_line)
        details_text_size = wx.Size(one_line_size[0],
                                    one_line_size[1] * len(traceback_lines))
    details.SetInitialSize(details.GetSizeFromTextSize(details_text_size))
    dialog.SetSizerAndFit(sizer)
    dialog.Centre()
    dialog.ShowModal()