mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user