(20241223) Exception handling in Quart API endpoints can now return stuff.
This commit is contained in:
@@ -1255,8 +1255,8 @@ def handle_failed_request(cleanup_func = None, cleanup_coro = None):
|
||||
except Exception as exception:
|
||||
kwargs["decorator_count"] -= 1
|
||||
if hasattr(current_app, "printer"): getattr(current_app, "printer")(exception)
|
||||
if cleanup_func is not None: cleanup_func()
|
||||
if cleanup_coro is not None: await cleanup_coro()
|
||||
if cleanup_func is not None: return cleanup_func()
|
||||
if cleanup_coro is not None: return await cleanup_coro()
|
||||
raise exception
|
||||
|
||||
return wrapper
|
||||
|
||||
Reference in New Issue
Block a user