Try not to stringify exception in logging messages

This just fixes the worst offenders that trip up error reporting tools
like Sentry.io
This commit is contained in:
Markus Unterwaditzer
2018-09-29 22:20:20 +02:00
parent 076cf51fb2
commit 0e33d46ead
4 changed files with 21 additions and 19 deletions

View File

@@ -1,4 +1,3 @@
import traceback
from json import JSONDecodeError
from sanic.log import logger
from sanic.exceptions import MethodNotSupported
@@ -73,8 +72,7 @@ class SanicTestClient:
**request_kwargs)
results[-1] = response
except Exception as e:
logger.error(
'Exception:\n{}'.format(traceback.format_exc()))
logger.exception('Exception')
exceptions.append(e)
self.app.stop()