Add traceback info to common error handler (#1708)

When an internal server error
occurs, the logged error is not really useful for the user.
For example, a `KeyError` will only print the missing key instead of the
full stacktrace and error.

Adding it to the common error handler as that one is meant to catch all
remaining errors, `HTTPException`s are handled by another error handler.
This commit is contained in:
Ruwann
2023-06-01 11:06:59 +02:00
committed by GitHub
parent 0c0c517cf6
commit a34da315db

View File

@@ -52,7 +52,7 @@ class ExceptionMiddleware(StarletteExceptionMiddleware):
@staticmethod
def common_error_handler(_request: StarletteRequest, exc: Exception) -> Response:
logger.error(exc)
logger.error(exc, exc_info=exc)
response = InternalServerError().to_problem()