server.web.hooks_and_handlers

Attributes

logger

Functions

_record_exception_in_span(→ None)

Record exception details in the current OpenTelemetry span.

_handle_error(→ Any)

Handle all exceptions in a uniform manner.

add_hooks_and_handlers(→ fastapi.FastAPI)

Add logging hooks and exception handlers.

Module Contents

server.web.hooks_and_handlers.logger[source]
server.web.hooks_and_handlers._record_exception_in_span(error: Exception) None[source]

Record exception details in the current OpenTelemetry span.

server.web.hooks_and_handlers._handle_error(request: fastapi.Request, error: Exception, status_code: int | None = None) Any[source]

Handle all exceptions in a uniform manner.

server.web.hooks_and_handlers.add_hooks_and_handlers(app: fastapi.FastAPI) fastapi.FastAPI[source]

Add logging hooks and exception handlers.