API docs: fresco.exceptions

exception fresco.exceptions.ResponseException(content=None, **kwargs)

An exception class with an associated fresco.response.Response instance that will render a suitable error page.

is_final = True

If true, the error response will be returned immediately without trying any other routes.

exception fresco.exceptions.NotFound(content=None, **kwargs)

Raised when a view needs to signal a 404 not found condition.

exception fresco.exceptions.Unauthorized(content=None, **kwargs)

Return a 401 Unauthorized response.

Use this when you want to flag that the user does not have permission to access a resource but may be able to gain access, eg by logging in.

exception fresco.exceptions.Forbidden(content=None, **kwargs)

Return a 403 Forbidden response

Use this when you want to flag that the user does not have permission to access a resource and that there is no possiblity to do so (eg they are already logged in, but their account does not have the right access permissions)

exception fresco.exceptions.BadRequest(content=None, **kwargs)

Return a 400 Bad Request response

fresco.exceptions.Redirect

alias of RedirectTemporary

exception fresco.exceptions.RedirectTemporary(*args, **kwargs)

Return a 302 Found response. Example:

raise RedirectTemporary(‘http://example.org/‘)

exception fresco.exceptions.RedirectPermanent(*args, **kwargs)

Return a 301 Moved Permanently response. Example:

raise RedirectPermanent(‘http://example.org/‘)