src/dazzle_back/runtime/exception_handlers.py¶
Generated: 2026-03-30T04:38:47.186206+00:00
Commit: 615f1354a103
Language: python
Scope: dazzle_back
Purpose¶
Exception handlers for DNR-Back applications.
Provides centralized exception handling for: - State machine transition errors - Invariant violations - Pydantic validation errors - Custom 404 pages for site rendering
HTMX-aware: when HX-Request header is present, validation errors return rendered HT...
Key Exports¶
register_exception_handlersregister_site_error_handlersconstraint_violation_handlertransition_error_handlerinvariant_error_handlervalidation_error_handlercustom_http_error_handler
Dependencies¶
Imports¶
pathlib.Pathtyping.Anyfastapi.FastAPIfastapi.responses.Responsefastapi.Requestfastapi.responses.JSONResponsepydantic.ValidationErrordazzle_back.runtime.htmx_response.HtmxDetailsdazzle_back.runtime.htmx_response.json_or_htmx_errordazzle_back.runtime.invariant_evaluator.InvariantViolationErrordazzle_back.runtime.repository.ConstraintViolationErrordazzle_back.runtime.state_machine.TransitionErrorstarlette.exceptions.HTTPExceptiondazzle_ui.runtime.site_context.build_site_404_contextdazzle_ui.runtime.site_context.build_site_error_contextdazzle_ui.runtime.template_renderer.render_site_pagefastapi.responses.HTMLResponsefastapi.responses.JSONResponse
Event Interactions¶
None detected.
Invariants and Assumptions¶
No invariants documented.
Tests¶
tests/unit/test_exception_handlers.pytests/integration/test_runtime_e2e.pytests/integration/test_runtime_pipeline.pytests/unit/test_runtime_test_routes.pytests/unit/test_runtime_services.py
Notes¶
This page was automatically generated by tools/gen_reference_docs.py.