Skip to content

raise specific exceptions for unconfigured features used at runtime - #3869

Open
mmerickel wants to merge 1 commit into
mainfrom
missing-configuration-errors
Open

mmerickel wants to merge 1 commit into
mainfrom
missing-configuration-errors

Conversation

@mmerickel

@mmerickel mmerickel commented Dec 3, 2026 •

Copy link
Copy Markdown
Member
  • MissingSessionFactoryError (AttributeError) from request.session and the session-based CSRF storage policies when no session factory is registered.
  • MissingRouteError (KeyError) when generating a URL for an unknown route name. Has a new route_name attribute.
  • MissingStaticViewError (ValueError) when no static view matches the requested asset. Has a new path attribute with the asset spec.
  • MissingRendererFactoryError (ValueError) when no renderer factory is registered for a renderer name or extension. Has a new renderer_type attribute.

Messages are unchanged and inherit from their old exception types so this remains bw-compat.

Fixes #3627
Replaces #3868

- MissingSessionFactoryError (AttributeError) from request.session and
  the session-based CSRF storage policies when no session factory is
  registered.
- MissingRouteError (KeyError) when generating a URL for an unknown
  route name. Has a new ``route_name`` attribute.
- MissingStaticViewError (ValueError) when no static view matches the
  requested asset. Has a new ``path`` attribute with the asset spec.
- MissingRendererFactoryError (ValueError) when no renderer factory is
  registered for a renderer name or extension. Has a new ``renderer_type``
  attribute.

Messages are unchanged and inherit from their old exception types so
this remains bw-compat.

Fixes #3627
@mmerickel
mmerickel force-pushed the missing-configuration-errors branch from 69269bf to 4a891bc Compare December 3, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: custom exception for session configuration errors

1 participant