Skip to content

Commit

Permalink
Fix bug in generic exception handling
Browse files Browse the repository at this point in the history
Generic error handling passes correct request and exception arguments.
  • Loading branch information
bloomonkey committed Aug 23, 2023
1 parent d4d1343 commit f4a7a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Generic error handling passes correct request and exception arguments

## [0.6.0.beta1] - 2023-08-23
## [0.6.0] - 2023-08-23
### Changed
- Return an asynchronous function from build_predictor
- Use orjson to serialize responses from app returned by build_app
Expand Down
4 changes: 2 additions & 2 deletions fastapi_mlflow/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def handle_serialisable_exception(
)

@app.exception_handler(Exception)
def handle_exception(_: Request, exc: Exception) -> ORJSONResponse:
def handle_exception(req: Request, exc: Exception) -> ORJSONResponse:
return handle_serialisable_exception(
DictSerialisableException.from_exception(exc)
req, DictSerialisableException.from_exception(exc)
)

return app

0 comments on commit f4a7a4f

Please sign in to comment.