core.errors

Module Contents

exception core.errors.HTTPException(status: int, name: str, descr: str)

Bases: Exception

Base-Class for all Exceptions that should match to an http error-code

process()
exception core.errors.BadRequest(descr: str = 'The request your browser sent cannot be fulfilled due to bad syntax.')

Bases: HTTPException

BadRequest

exception core.errors.Redirect(url: str, descr: str = 'Redirect', status: int = 303)

Bases: HTTPException

Causes an 303 - See Other (or 302 - Found if requested / 301 - Moved Permanently) redirect

exception core.errors.Unauthorized(descr: str = "The resource is protected and you don't have the permissions.")

Bases: HTTPException

Unauthorized

Raised whenever a request hits an path protected by canAccess() or a canAdd/canEdit/… -Function inside an application returns false.

exception core.errors.PaymentRequired(descr: str = 'Payment Required')

Bases: HTTPException

PaymentRequired

Not used inside viur.core. This status-code is reserved for further use and is currently not supported by clients.

exception core.errors.Forbidden(descr: str = "The resource is protected and you don't have the permissions.")

Bases: HTTPException

Forbidden

Not used inside viur.core. May be utilized in the future to distinguish between requests from guests and users, who are logged in but don’t have the permission.

exception core.errors.NotFound(descr: str = 'The requested resource could not be found.')

Bases: HTTPException

NotFound

Usually raised in view() methods from application if the given key is invalid.

exception core.errors.MethodNotAllowed(descr: str = 'Method Not Allowed')

Bases: HTTPException

MethodNotAllowed

Raised if a function is accessed which doesn’t have the @exposed / @internalExposed decorator or if the request arrived using get, but the function has the @forcePost flag.

exception core.errors.NotAcceptable(descr: str = 'The request cannot be processed due to missing or invalid parameters.')

Bases: HTTPException

NotAcceptable

Signals that the parameters supplied doesn’t match the function signature

exception core.errors.RequestTimeout(descr: str = 'The request has timed out.')

Bases: HTTPException

RequestTimeout

This must be used for the task api to indicate it should retry

exception core.errors.Gone(descr: str = 'Gone')

Bases: HTTPException

Gone

Not used inside viur.core

exception core.errors.PreconditionFailed(descr: str = 'Precondition Failed')

Bases: HTTPException

PreconditionFailed

Mostly caused by a missing/invalid securitykey.

exception core.errors.RequestTooLarge(descr: str = 'Request Too Large')

Bases: HTTPException

RequestTooLarge

Not used inside viur.core

exception core.errors.Locked(descr: str = 'Ressource is Locked')

Bases: HTTPException

Locked

Raised if a resource cannot be deleted due to incomming relational locks

exception core.errors.TooManyRequests(descr: str = 'Too Many Requests')

Bases: HTTPException

Too Many Requests

The 429 status code indicates that the user has sent too many requests in a given amount of time (“rate limiting”).

exception core.errors.Censored(descr: str = 'Unavailable For Legal Reasons')

Bases: HTTPException

Censored

Not used inside viur.core

exception core.errors.InternalServerError(descr: str = 'Internal Server Error')

Bases: HTTPException

InternalServerError

The catch-all error raised by the server if your code raises any python-exception not deriving from HTTPException

exception core.errors.NotImplemented(descr: str = 'Not Implemented')

Bases: HTTPException

NotImplemented

Not really implemented at the moment :)

exception core.errors.BadGateway(descr: str = 'Bad Gateway')

Bases: HTTPException

BadGateway

Not used inside viur.core

exception core.errors.ServiceUnavailable(descr: str = 'Service Unavailable')

Bases: HTTPException

ServiceUnavailable

Not used inside viur.core