def get_extension_for_category(filedata, category): try: _, fmt = file_type_for_category(filedata, _categories[category]) except UnknownFileFormat as uff: e = WeasylError('FileType') e.error_suffix = uff.args[0] raise e except InvalidFileFormat as iff: e = WeasylError('FileType') e.error_suffix = iff.args[0] raise e else: return '.' + fmt
def wrapper(*a, **kw): try: return func(*a, **kw) except Exception as e: capture_exception(e, level='info') w = WeasylError('httpError') w.error_suffix = 'The original error was: %s' % (e, ) raise w from e
def wrapper(*a, **kw): request = get_current_request() try: return func(*a, **kw) except Exception as e: request.log_exc(level=logging.DEBUG) w = WeasylError('httpError') w.error_suffix = 'The original error was: %s' % (e,) raise w
def wrapper(*a, **kw): request = get_current_request() try: return func(*a, **kw) except Exception as e: request.log_exc(level=logging.DEBUG) w = WeasylError('httpError') w.error_suffix = 'The original error was: %s' % (e,) raise w