From d9f6846c7641e6ae9c4ea4c688a4d24f56e83a8b Mon Sep 17 00:00:00 2001 From: Jack Fischer Date: Wed, 16 Nov 2016 07:55:54 -0500 Subject: [PATCH] improved default handling --- examples/exception_monitoring.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/exception_monitoring.py b/examples/exception_monitoring.py index 51f8bfba..34b46a14 100644 --- a/examples/exception_monitoring.py +++ b/examples/exception_monitoring.py @@ -28,9 +28,10 @@ class CustomHandler(Handler): if not issubclass(type(exception), SanicException): print(exception) - # Then, we must finish handling the exception by - # returning our response to the client - return text("An error occured", status=500) + # Then, we must finish handling the exception by returning + # our response to the client + # For this we can just call the super class' default handler + return super.default(self, request, exception) @@ -56,4 +57,4 @@ async def test(request): return json({"test": True}) -app.run(host="0.0.0.0", port=8000) +app.run(host="0.0.0.0", port=8000, debug=True)