diff --git a/pyproject.toml b/pyproject.toml index ce8c7649..acb18b24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,4 +67,5 @@ asyncio_mode = "auto" target-version = "py312" [tool.ruff.lint] -extend-select = ["I"] +# Catch jump control statements in finally (B012) +extend-select = ["B012","I"] diff --git a/src/nsls2api/exception_handlers.py b/src/nsls2api/exception_handlers.py index a3e4ef08..53434d02 100644 --- a/src/nsls2api/exception_handlers.py +++ b/src/nsls2api/exception_handlers.py @@ -9,7 +9,7 @@ # This is to make sure we add the request ID to the response headers for the case # of unhandled server errors. @app.exception_handler(Exception) -async def unhandled_exception_handler(request: Request, exc: Exception) -> JSONResponse: +async def unhandled_exception_handler(request: Request, exc: Exception): return await http_exception_handler( request, HTTPException(