Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions connexion/middleware/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class ExceptionMiddleware(StarletteExceptionMiddleware):
def __init__(self, next_app: ASGIApp):
super().__init__(next_app)
self.add_exception_handler(ProblemException, self.problem_handler) # type: ignore
self.add_exception_handler(Exception, self.common_error_handler)

def add_exception_handler(
self,
Expand Down Expand Up @@ -89,13 +88,5 @@ def http_exception(
headers=exc.headers,
)

@staticmethod
def common_error_handler(
_request: StarletteRequest, exc: Exception
) -> ConnexionResponse:
"""Default handler for any unhandled Exception"""
logger.error("%r", exc, exc_info=exc)
return InternalServerError().to_problem()

async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
await super().__call__(scope, receive, send)