(20241223) Exception handling in Quart API endpoints can now return stuff.

This commit is contained in:
2024-12-23 16:27:04 +05:30
parent 78ce884e87
commit 3296fec639
18 changed files with 1373 additions and 2 deletions
+2 -2
View File
@@ -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