Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 627 Bytes

index.rst

File metadata and controls

9 lines (7 loc) · 627 Bytes

Error handling with exception mappers

For basic error handling, Jivago provides an ExceptionMapper mechanism, which can automatically create an HTTP response for an uncaught exception. To define a custom exception mapper, create a component which inherits from the ExceptionMapper interface, implementing the handles and create_response methods.

exception_mapper.py

  • handles(exception) -> bool : Used to find the corresponding exception mapper.
  • create_response(exception) -> Response : Creates the actual HTTP response.