:py:mod:`core.errors` ===================== .. py:module:: core.errors Module Contents --------------- .. py:exception:: HTTPException(status, name, descr) Bases: :py:obj:`Exception` Base-Class for all Exceptions that should match to an http error-code :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:method:: process() .. py:exception:: BadRequest(descr = 'The request your browser sent cannot be fulfilled due to bad syntax.') Bases: :py:obj:`HTTPException` BadRequest :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Redirect(url, descr = 'Redirect', status = 303) Bases: :py:obj:`HTTPException` Causes an 303 - See Other (or 302 - Found if requested / 301 - Moved Permanently) redirect :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Unauthorized(descr = "The resource is protected and you don't have the permissions.") Bases: :py:obj:`HTTPException` Unauthorized Raised whenever a request hits an path protected by canAccess() or a canAdd/canEdit/... -Function inside an application returns false. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: PaymentRequired(descr = 'Payment Required') Bases: :py:obj:`HTTPException` PaymentRequired Not used inside viur.core. This status-code is reserved for further use and is currently not supported by clients. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Forbidden(descr = "The resource is protected and you don't have the permissions.") Bases: :py:obj:`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. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: NotFound(descr = 'The requested resource could not be found.') Bases: :py:obj:`HTTPException` NotFound Usually raised in view() methods from application if the given key is invalid. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: MethodNotAllowed(descr = 'Method Not Allowed') Bases: :py:obj:`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. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: NotAcceptable(descr = 'The request cannot be processed due to missing or invalid parameters.') Bases: :py:obj:`HTTPException` NotAcceptable Signals that the parameters supplied doesn't match the function signature :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: RequestTimeout(descr = 'The request has timed out.') Bases: :py:obj:`HTTPException` RequestTimeout This must be used for the task api to indicate it should retry :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Gone(descr = 'Gone') Bases: :py:obj:`HTTPException` Gone The 410 (Gone) status code indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent. If the origin server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) ought to be used instead. See https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.9 :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: PreconditionFailed(descr = 'Precondition Failed') Bases: :py:obj:`HTTPException` PreconditionFailed Mostly caused by a missing/invalid securitykey. :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: RequestTooLarge(descr = 'Request Too Large') Bases: :py:obj:`HTTPException` RequestTooLarge Not used inside viur.core :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Locked(descr = 'Ressource is Locked') Bases: :py:obj:`HTTPException` Locked Raised if a resource cannot be deleted due to incomming relational locks :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: TooManyRequests(descr = 'Too Many Requests') Bases: :py:obj:`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"). :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: UnprocessableEntity(descr = 'Unprocessable Entity') Bases: :py:obj:`HTTPException` Unprocessable Entity The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415 (Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions See https://www.rfc-editor.org/rfc/rfc4918#section-11.2 :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: Censored(descr = 'Unavailable For Legal Reasons') Bases: :py:obj:`HTTPException` Censored Not used inside viur.core :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: InternalServerError(descr = 'Internal Server Error') Bases: :py:obj:`HTTPException` InternalServerError The catch-all error raised by the server if your code raises any python-exception not deriving from HTTPException :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: NotImplemented(descr = 'Not Implemented') Bases: :py:obj:`HTTPException` NotImplemented Not really implemented at the moment :) :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: BadGateway(descr = 'Bad Gateway') Bases: :py:obj:`HTTPException` BadGateway Not used inside viur.core :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error .. py:exception:: ServiceUnavailable(descr = 'Service Unavailable') Bases: :py:obj:`HTTPException` ServiceUnavailable Not used inside viur.core :param status: The desired http error-code (404, 500, ...) :param name: Name as of RFC 2616 :param descr: Human-readable description of that error