def __init__(self, message, ex = None): if ex: try: message += "\n\n(exact error: %s)" % ex except: # Some Python messages have type str but contain UTF-8 sequences. # (e.g. IOException). Adding these to a Unicode 'message' (e.g. # after gettext translation) will cause an error. import codecs decoder = codecs.lookup('utf-8') decex = decoder.decode(str(ex), errors = 'replace')[0] message += "\n\n(exact error: %s)" % decex SafeException.__init__(self, message)
def __init__(self, message, ex=None): if ex: message += "\n\n(exact error: %s)" % ex SafeException.__init__(self, message)
def __init__(self, message = None): SafeException.__init__(self, message or _("Download aborted at user's request"))
def __init__(self, message): SafeException.__init__( self, message or _("Download aborted at user's request"))