Documentation in progress Edit me on GitHub

pyramid.exceptions

exception BadCSRFToken(detail=None, headers=None, comment=None, body_template=None, **kw)[source]

This exception indicates the request has failed cross-site request forgery token validation.

exception PredicateMismatch(detail=None, headers=None, comment=None, body_template=None, **kw)[source]

This exception is raised by multiviews when no view matches all given predicates.

This exception subclasses the HTTPNotFound exception for a specific reason: if it reaches the main exception handler, it should be treated as HTTPNotFound` by any exception view registrations. Thus, typically, this exception will not be seen publicly.

However, this exception will be raised if the predicates of all views configured to handle another exception context cannot be successfully matched. For instance, if a view is configured to handle a context of HTTPForbidden and the configured with additional predicates, then PredicateMismatch will be raised if:

  • An original view callable has raised HTTPForbidden (thus invoking an exception view); and
  • The given request fails to match all predicates for said exception view associated with HTTPForbidden.

The same applies to any type of exception being handled by an exception view.

Forbidden

alias of HTTPForbidden

NotFound

alias of HTTPNotFound

exception ConfigurationError[source]

Raised when inappropriate input values are supplied to an API method of a Configurator

exception URLDecodeError[source]

This exception is raised when Pyramid cannot successfully decode a URL or a URL path segment. This exception behaves just like the Python builtin UnicodeDecodeError. It is a subclass of the builtin UnicodeDecodeError exception only for identity purposes, mostly so an exception view can be registered when a URL cannot be decoded.

Previous topic

pyramid.events

Next topic

pyramid.httpexceptions