Documentation in progress Edit me on GitHub


class 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.

class 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.


alias of HTTPForbidden


alias of HTTPNotFound

class ConfigurationError[source]

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

class 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

Next topic