Roadmap¶
Errium's core (errium_core) is framework-agnostic by design; the work ahead is mostly about
adding thin adapters on top of it (see ARCHITECTURE.md for how an adapter is structured) and
rounding out the classification coverage in the core itself.
Done¶
- Core classification pipeline —
ClassificationEngine, theExceptionClassifierprotocol,StandardizedError/ClassifiedErrorcontracts,DefaultFormatter,ValidationNormalizer, dev/prod sanitization viaERRIUM_DEBUG. - FastAPI adapter (
errium) —ErriumMiddlewarefor uncaught exceptions and HTTP exceptions,validation_exception_handlerwith beautified validationdetails. - Flask adapter (
errium_flask) —ErriumFlaskextension covering Werkzeug HTTP exceptions, generic exceptions, and beautified pydantic validation errors raised manually inside views. - Django Ninja adapter (
errium_ninja) —register_errium(api)covering Ninja'sValidationError/HttpError(and itsAuthenticationError/AuthorizationError/Throttledsubclasses), Django'sHttp404, and generic exceptions, overriding Ninja's built-in defaults (which otherwise re-raise uncaught exceptions in production instead of returning JSON). Also strips Ninja's synthetic parameter-name wrapper from validation error locations sodetailskeys match the other adapters. - Django REST Framework adapter (
errium_drf) —errium_exception_handler, wired viaREST_FRAMEWORK["EXCEPTION_HANDLER"], coveringValidationError(keeping DRF's own 400 status code), theAPIExceptionfamily, Django'sHttp404, andPermissionDenied. Achieves full catch-everything coverage — including raw uncaught exceptions — since it never returnsNonethe way DRF's own default handler does; this corrects an earlier assumption (below, when this was still "planned") that a separate Django middleware would be needed for that. Has its ownflatten_drf_errorsnormalizer, since DRF'sErrorDetailtree shape differs from pydantic'sloc/type/msg. Also mirrors DRF'sWWW-Authenticate/Retry-Afterheader behavior for auth challenges and throttling. - Database error classification —
DatabaseExceptionClassifiermaps SQLAlchemy errors toDATABASE_ERROR, and integrity errors that look like uniqueness violations toDUPLICATE_RESOURCE, without a hard SQLAlchemy dependency. - Published on PyPI —
errium0.1.0 is available at https://pypi.org/project/errium/ (pip install errium), withflask,ninja, anddrfextras. All five packages shippy.typed. The distribution depends onfastapirather thanfastapi[standard], so Flask and Django users don't inherit a server and CLI toolchain. - CI — GitHub Actions workflow running
ruff check,ruff format --check,mypy, andpytestacross Python 3.11/3.12 on every push and PR tomain.
Planned¶
- Express.js adapter (JavaScript port) — a separate package outside the Python distribution; would need its own port of the core contracts, not just an adapter.
- AI-powered developer suggestions & self-healing hints — extending
DefaultFormatter._get_debug_hints(currently a static, status-code-keyed lookup) with more context-aware, possibly model-generated suggestions in debug mode.
Notes for contributors¶
When picking up a new framework adapter, follow the pattern documented in ARCHITECTURE.md
("Design goal: core vs. adapters"): a new src/errium_<framework> package containing
framework-specific ExceptionClassifiers plus one integration point that builds a
ClassificationEngine, classifies, formats, and returns the framework's native response type.
Nothing in errium_core should need to change to support a new framework.