From cc43ee3b3db08c8b05ca8c9d67514f4b404e5a49 Mon Sep 17 00:00:00 2001 From: zkanda Date: Tue, 17 Jan 2017 19:17:42 +0800 Subject: [PATCH] Always log of there's an exception occured. --- sanic/exceptions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sanic/exceptions.py b/sanic/exceptions.py index 430f1d29..f1d81878 100644 --- a/sanic/exceptions.py +++ b/sanic/exceptions.py @@ -173,6 +173,7 @@ class Handler: try: response = handler(request=request, exception=exception) except: + log.error(format_exc()) if self.sanic.debug: response_message = ( 'Exception raised in exception handler "{}" ' @@ -185,6 +186,7 @@ class Handler: return response def default(self, request, exception): + log.error(format_exc()) if issubclass(type(exception), SanicException): return text( 'Error: {}'.format(exception),