Map Python exceptions to HTTP error codes.

exception server.errors.HTTPException(status, name, descr)

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

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

Not used inside the server

exception server.errors.Redirect(url, descr='Redirect', status=303)

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

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

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

exception server.errors.PaymentRequired(descr='Payment Required')

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

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

Not used inside the server. 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 server.errors.NotFound(descr='The requested resource could not be found.')

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

exception server.errors.MethodNotAllowed(descr='Method Not Allowed')

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 server.errors.NotAcceptable(descr='The request cannot be processed due to missing or invalid parameters.')

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

exception server.errors.RequestTimeout(descr='The request has timed out.')

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

exception server.errors.Gone(descr='Gone')

Not used inside the server

exception server.errors.PreconditionFailed(descr='Precondition Failed')

Mostly caused by a missing/invalid securitykey.

exception server.errors.RequestTooLarge(descr='Request Too Large')

Not used inside the server

exception server.errors.Censored(descr='Unavailable For Legal Reasons')

Not used inside the server

exception server.errors.InternalServerError(descr='Internal Server Error')

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

exception server.errors.NotImplemented(descr='Not Implemented')

Not really implemented at the moment :)

exception server.errors.BadGateway(descr='Bad Gateway')

Not used

exception server.errors.ServiceUnavailable(descr='Service Unavailable')

Raised if the flag “viur.disabled” in conf.sharedConf is set

class server.errors.ReadFromClientError(errors, forceFail=False)

Internal use only. Used as a return-value (its not raised!) to transport information on errors from fromClient in bones to the surrounding skeleton class