diff --git a/sanic/sanic.py b/sanic/sanic.py index 033b1e9d..2f5a405a 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -217,6 +217,14 @@ class Sanic: # -------------------------------------------- # # Response Generation Failed # -------------------------------------------- # + if self.debug: + error_body = response.body + if isinstance(error_body, bytes): + try: + error_body = error_body.decode() + except: + pass + log.debug(error_body) try: response = self.error_handler.response(request, e)