parameters: (func)
return_statement: return wrapper
docstring: Catch exceptions of type error.Error and gizmo.Error
      and show them in error window
docstring_summary: Catch exceptions of type error.Error and gizmo.Error
      and show them in error window
docstring_tokens: Catch exceptions of type error . Error and gizmo . Error and show them in error window
function: def error_dlg(func):
      '''Catch exceptions of type error.Error and gizmo.Error
      and show them in error window
      '''
      @wraps(func)
      def wrapper(*args, **kwargs):
          try:
              return func(*args, **kwargs)
          except Exception as err:
              logger.warn('error_dlg: %r', err, exc_info=True)
  
              if len(args) > 0 and isinstance(args[0], wx.Window):
                  parent = args[0]
              else:
                  parent = None
  
              showExceptionDlg(parent)
      return wrapper
function_tokens: def error_dlg ( func ) : @ wraps ( func ) def wrapper ( * args , * * kwargs ) : try : return func ( * args , * * kwargs ) except Exception as err : logger . warn ( 'error_dlg: %r' , err , exc_info = True ) if len ( args ) > 0 and isinstance ( args [ 0 ] , wx . Window ) : parent = args [ 0 ] else : parent = None showExceptionDlg ( parent ) return wrapper