Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Exceptions

exception luxon.exceptions.AccessDeniedError(message)[source]

Access Denied.

This error indicates that the server understood the request but refuses to authorize it. A server that wishes to make public why the request has been forbidden can describe that reason using message arguement.

If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials.

Parameters:message (str) – Reason for access denied.
exception luxon.exceptions.DuplicateError(message)[source]

Duplicate Error.

Parameters:message (str) – Reason for validation error.
exception luxon.exceptions.Error[source]

Luxon BaseException

exception luxon.exceptions.ExecuteError(cmd, stderr)[source]

Execute Error.

Execute of command returned non-zero exit status.

exception luxon.exceptions.FieldError(field, label, description, value)[source]

Field Error.

The value of the specified field is invalid. Typically used by models.

Parameters:
  • field (str) – The actual field id/descriptor.
  • label (str) – User friendly field title/name.
  • description (str) – Field Description.
  • value (str) – Field value used.
exception luxon.exceptions.FieldMissing(field, label, description)[source]

Field Missing.

The value of the specified field is missing. Typically used by models.

Parameters:
  • field (str) – The actual field id/descriptor.
  • label (str) – User friendly field title/name.
  • description (str) – Field Description.
exception luxon.exceptions.HTTPBadGateway(*args, **kwargs)[source]

502 Bad Gateway.

The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

Reference RFC 7231, Section 6.6.3

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘502 Bad Gateway’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPBadRequest(*args, **kwargs)[source]

400 Bad Request.

The 400 Bad Request indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

Reference RFC 7231, Section 6.5.1

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘400 Bad Request’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPClientChunkedEncodingError(message)[source]

HTTP Client Chunked Encoding Error

The server declared chunked encoding but sent an invalid chunk.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientConnectTimeoutError(message)[source]

HTTP Connect Timeout Error.

The request timed out while trying to connect to the remote server.

Requests that produced this error are safe to retry.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientConnectionError(message)[source]

HTTP Connection Error.

A Connection error occurred.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientContentDecodingError(message)[source]

HTTP Client Content Decoding Error

Failed to decode response content

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientDependencyWarning[source]

HTTP Client Dependency Warning

An imported dependency doesn’t match the expected version range.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientError(status=500, description=None, title=None, headers={}, href=None)[source]

RESTful API Client Error.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientFileModeWarning[source]

HTTP Client File Mode Warning

A file was opened in text mode, but Requests determined its binary length.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientInvalidHeader(message)[source]

HTTP Client Invalid Header

The header value provided was somehow invalid.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientInvalidProxyURL(message)[source]

HTTP Client Invalid Proxy URL

The proxy URL provided is invalid.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientInvalidSchema(message)[source]

HTTP Client Invalid Schema

See defaults.py for valid schemas.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientInvalidURL(message)[source]

HTTP Client Invalid URL

The URL provided was somehow invalid.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientMissingSchema(message)[source]

HTTP Client Missing Schema

The URL schema (e.g. http or https) is missing.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientProxyError(message)[source]

HTTP Proxy Error.

A proxy error occurred.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientReadTimeoutError(message)[source]

HTTP Client Read Timeout Error.

The server did not send any data in the allotted amount of time.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientRetryError(message)[source]

HTTP Client Retry Error

Custom retries logic failed

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientSSLError(message)[source]

HTTP SSL Error.

An SSL error occurred.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientStreamConsumedError(message)[source]

HTTP Client Stream Consumed Error

The content for this response was already consumed

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientTimeoutError(message)[source]

HTTP Timeout Error.

This error is raised during HTTP Timeout.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientTooManyRedirects(message)[source]

HTTP Client Too Many Redirects Error.

Too Many Redirects

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientURLRequired(message)[source]

HTTP Client URL Required Error.

A valid URL is required to make a request.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientUnrewindableBodyError(message)[source]

HTTP Client Unrewindeable Body Error

Requests encountered an error when trying to rewind a body

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPClientWarning[source]

HTTP Client Warning.

Base warning for Requests.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.HTTPConflict(*args, **kwargs)[source]

409 Conflict.

The 409 Conflict status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. The server SHOULD generate a payload that includes enough information for a user to recognize the source of the conflict.

Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the representation being PUT included changes to a resource that conflict with those made by an earlier (third-party) request, the origin server might use a 409 response to indicate that it can’t complete the request. In this case, the response representation would likely contain information useful for merging the differences based on the revision history.

Reference RFC 7231, Section 6.5.8

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘409 Conflict’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPError(status=500, description=None, title=None, headers={}, href=None)[source]

Base HTTP Error.

All other HTTP errors use this as the base class.

Keyword Arguments:
 
  • status (int) – HTTP Status code.
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘400 Bad Request’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPFailedDependency(*args, **kwargs)[source]

424 Failed Dependency.

The 424 (Failed Dependency) status code means that the method could not be performed on the resource because the requested action depended on another action and that action failed.

Reference RFC 4918, Section 11.4

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘424 Failed Dependency’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPForbidden(*args, **kwargs)[source]

403 Forbidden.

The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it. A server that wishes to make public why the request has been forbidden can describe that reason in the response payload (if any).

If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.

An origin server that wishes to “hide” the current existence of a forbidden target resource MAY instead respond with a status code of 404 (Not Found).

Reference RFC 7231, Section 6.5.3

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘403 Forbidden’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPGatewayTimeout(*args, **kwargs)[source]

504 Gateway Timeout.

The 504 Gateway Timeout status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request.

Reference RFC 7231, Section 6.6.5

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘504 Gateway Timeout’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPGone(*args, **kwargs)[source]

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

The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer associated with the origin server’s site. It is not necessary to mark all permanently unavailable resources as “gone” or to keep the mark for any length of time – that is left to the discretion of the server owner.

A 410 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of RFC7234).

Reference RFC 7231, Section 6.5.9

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘410 Gone’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPInsufficientStorage(*args, **kwargs)[source]

507 Insufficient Storage.

The 507 Insufficient Storage status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request that received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.

Reference RFC 4918, Section 11.5

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘507 Insufficient Storage’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPInternalServerError(*args, **kwargs)[source]

500 Internal Server Error.

The server encountered an unexpected condition that prevented it from fulfilling the request.

Reference RFC 7231, Section 6.6.1

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘500 Internal Server Error’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPInvalidFormField(field, title=None, href=None)[source]

Form field in the request is invalid.

Parameters:

param (str) – Query string parameter.

Keyword Arguments:
 
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPInvalidHeader(header_name, msg='', title=None, href=None)[source]

Header in the request is invalid.

Parameters:

header_name (str) – Header name.

Keyword Arguments:
 
  • msg (str) – The actual reason for being invalid.
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPInvalidQueryParam(param, title=None, href=None)[source]

Query String parameter in the request is invalid.

Parameters:

param (str) – Query string parameter.

Keyword Arguments:
 
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPLengthRequired(description='Content-Length header required.', **kwargs)[source]

411 Length Required.

The 411 Length Required status code indicates that the server refuses to accept the request without a defined Content-Length (Section 3.3.2 of RFC7230). The client MAY repeat the request if it adds a valid Content-Length header field containing the length of the message body in the request message.

Reference RFC 7231, Section 6.5.10

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘411 Length Required’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPLocked(*args, **kwargs)[source]

423 Locked.

The 423 (Locked) status code means the source or destination resource of a method is locked. This response SHOULD contain an appropriate precondition or postcondition code, such as ‘lock-token-submitted’ or ‘no-conflicting-lock’.

Reference RFC 4918, Section 11.3

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘423 Locked’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPLoopDetected(*args, **kwargs)[source]

508 Loop Detected.

The 508 Loop Detected status code indicates that the server terminated an operation because it encountered an infinite loop while processing a request with “Depth: infinity”. This status indicates that the entire operation failed.

Reference RFC 5842, Section 7.2

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘508 Loop Detected’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPMethodNotAllowed(allowed_methods=[], description=None, title=None, headers={}, **kwargs)[source]

405 Method Not Allowed.

The 405 (Method Not Allowed) status code indicates that the method received in the request-line is known by the origin server but not supported by the target resource. The origin server MUST generate an Allow header field in a 405 response containing a list of the target resource’s currently supported methods.

A 405 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of RFC7234).

Reference RFC 7231, Section 6.5.5

Keyword Arguments:
 
  • allowed_methods (list of str) – Allowed HTTP methods for this resource. e.g. [‘GET’, ‘POST’,]
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘405 Method Not Allowed’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPMissingFormField(field, title=None, href=None)[source]

Query String parameter in the request is invalid.

Parameters:

param (str) – Query string parameter.

Keyword Arguments:
 
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPMissingHeader(header_name, title=None, href=None)[source]

Header is missing from the request.

Parameters:

header_name (str) – Header name.

Keyword Arguments:
 
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPMissingQueryParam(param, title=None, href=None)[source]

Query String parameter in the request is invalid.

Parameters:

param (str) – Query string parameter.

Keyword Arguments:
 
  • title (str) – Error title (default ‘400 Bad Request’)
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPNetworkAuthenticationRequired(*args, **kwargs)[source]

511 Network Authentication Required.

The 511 status code indicates that the client needs to authenticate to gain network access.

The response representation SHOULD contain a link to a resource that allows the user to submit credentials.

Note that the 511 response SHOULD NOT contain a challenge or the authentication interface itself, because clients would show the interface as being associated with the originally requested URL, which may cause confusion.

The 511 status SHOULD NOT be generated by origin servers; it is intended for use by intercepting proxies that are interposed as a means of controlling access to the network.

Responses with the 511 status code MUST NOT be stored by a cache.

Reference RFC 6585, Section 6

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Title (default ‘511 Network Authentication Required’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPNotAcceptable(*args, **kwargs)[source]

406 Not Acceptable.

The 406 Not Acceptable status code indicates that the target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request (RFC7234, Section 5.3), and the server is unwilling to supply a default representation.

The server SHOULD generate a payload containing a list of available representation characteristics and corresponding resource identifiers from which the user or user agent can choose the one most appropriate. A user agent MAY automatically select the most appropriate choice from that list. However, this specification does not define any standard for such automatic selection, as described in Section 6.4.1.

Reference RFC 7231, Section 6.5.6

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘405 Method Not Allowed’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPNotFound(*args, **kwargs)[source]

404 Not Found.

The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. A 404 status code does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent.

A 404 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls (see Section 4.2.2 of RFC7234).

Reference RFC 7231, Section 6.5.4

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘404 Not Found’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPNotImplemented(*args, **kwargs)[source]

501 Not Implemented.

The 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

A 501 response is cacheable by default unless otherwise indicated by the method definition or explicit cache controls as described in RFC 7234, Section 4.2.2.

Reference RFC 7231, Section 6.6.2

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘501 HTTPNotImplemented’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPPayloadTooLarge(*args, **kwargs)[source]

413 Payload Too Large.

The 413 Payload Too Large status code indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process. The server MAY close the connection to prevent the client from continuing the request.

If the condition is temporary, the server SHOULD generate a Retry-After header field to indicate that it is temporary and after what time the client MAY try again.

Reference RFC 7231, Section 6.5.11

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘413 Payload Too Large’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPPaymentRequired(*args, **kwargs)[source]

402 Payment Required.

The 402 Payment Required status code is reserved for future use.

Reference RFC 7231, Section 6.5.2

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘402 Payment Required’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPPreconditionFailed(*args, **kwargs)[source]

412 Precondition Failed.

The 412 Precondition Failed status code indicates that one or more conditions given in the request header fields evaluated to false when tested on the server. This response code allows the client to place preconditions on the current resource state (its current representations and metadata) and, thus, prevent the request method from being applied if the target resource is in an unexpected state.

Reference RFC 7232, Section 4.2

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘412 Precondition Failed’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPPreconditionRequired(*args, **kwargs)[source]

428 Precondition Required.

The 428 status code indicates that the origin server requires the request to be conditional.

Its typical use is to avoid the “lost update” problem, where a client GETs a resource’s state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict. By requiring requests to be conditional, the server can assure that clients are working with the correct copies.

Responses using this status code SHOULD explain how to resubmit the request successfully.

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘428 Precondition Required’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPRangeNotSatisfiable(resource_length, description=None, title=None, headers={}, **kwargs)[source]

416 Range Not Satisfiable.

The 416 (Range Not Satisfiable) status code indicates that none of the ranges in the request’s Range header field (Section 3.1) overlap the current extent of the selected resource or that the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges.

For byte ranges, failing to overlap the current extent means that the first-byte-pos of all of the byte-range-spec values were greater than the current length of the selected representation. When this status code is generated in response to a byte-range request, the sender SHOULD generate a Content-Range header field specifying the current length of the selected representation (Section 4.2).

For example:
HTTP/1.1 416 Range Not Satisfiable Date: Fri, 20 Jan 2012 15:41:54 GMT Content-Range: bytes */47022

Note: Because servers are free to ignore Range, many implementations will simply respond with the entire selected representation in a 200 (OK) response. That is partly because most clients are prepared to receive a 200 (OK) to complete the task (albeit less efficiently) and partly because clients might not stop making an invalid partial request until they have received a complete representation. Thus, clients cannot depend on receiving a 416 (Range Not Satisfiable) response even when it is most appropriate.

Reference RFC 7233, Section 4.4

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘416 Range Not Satisfiable’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPRequestHeaderFieldsTooLarge(*args, **kwargs)[source]

431 Request Header Fields Too Large.

The 431 status code indicates that the server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.

It can be used both when the set of request header fields in total is too large, and when a single header field is at fault. In the latter case, the response representation SHOULD specify which header field was too large.

Responses with the 431 status code MUST NOT be stored by a cache.

Reference RFC 6585, Section 5

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘429 Too Many Requests.’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPServiceUnavailable(*args, **kwargs)[source]

503 Service Unavailable.

The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.

The server MAY send a Retry-After header field to suggest an appropriate amount of time for the client to wait before retrying the request.

Note: The existence of the 503 status code does not imply that a server has to use it when becoming overloaded. Some servers might simply refuse the connection.

Reference RFC 7231, Section 6.6.4

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘503 Service Unavailable’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPTooManyRequests(*args, **kwargs)[source]

429 Too Many Requests.

The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time (“rate limiting”). A Retry-After header might be included to this response indicating how long to wait before making a new request.

Reference RFC 6585, Section 4

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘429 Too Many Requests.’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPUnauthorized(description=None, title=None, challenges=None, headers={}, **kwargs)[source]

401 Unauthorized.

This 401 Unauthorized indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. The server generating a 401 response MUST send a WWW-Authenticate header field (RFC 7231, Section 4.1) containing at least one challenge applicable to the target resource.

If the request included authentication credentials, then the 401 response indicates that authorization has been refused for those response indicates that authorization has been refused for those credentials. The user agent MAY repeat the request with a new or replaced Authorization header field (RFC 7231, Section 4.2). If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user agent SHOULD present the enclosed representation to the user, since it usually contains relevant diagnostic information.

Reference RFC 7235, Section 3.1

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘401 Unauthorized’)
  • challenges (dict) – A dict of one or more authentication challenges to use as the value of WWW-Authenticate header in response.
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPUnavailableForLegalReasons(*args, **kwargs)[source]

451 Unavailable For Legal Reasons.

451 Unavailable For Legal Reasons client error response code indicates that the user requested a resource that is not available due to legal reasons.

A 451 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls.

Reference RFC 7725, Section 3

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘451 Unavailable For Legal Reasons’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPUnprocessableEntity(*args, **kwargs)[source]

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

Reference RFC 4918, Section 11.2

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘422 Unprocessable Entity’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPUnsupportedMediaType(*args, **kwargs)[source]

415 Unsupported Media Type.

The 415 (Unsupported Media Type) status code indicates that the origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource. The format problem might be due to the request’s indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.

Reference RFC 7231, Section 6.5.13

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘415 Unsupported Media Type.’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPUriTooLong(*args, **kwargs)[source]

414 URI Too Long.

The 414 URI Too Long status code indicates that the server is refusing to service the request because the request-target (Section 5.3 of RFC7230) is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a “black hole” of redirection (e.g., a redirected URI prefix that points to a suffix of itself) or when the server is under attack by a client attempting to exploit potential security holes.

Reference RFC 7231, Section 6.5.12

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘414 URI Too Long’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.HTTPVersionNotSupported(*args, **kwargs)[source]

505 HTTP Version Not Supported

The 505 HTTP Version Not Supported status code indicates that the server does not support, or refuses to support, the major version of HTTP that was used in the request message. The server is indicating that it is unable or unwilling to complete the request using the same major version as the client (as described in RFC 7230, Section 2.6), other than with this error message. The server SHOULD generate a representation for the 505 response that describes why that version is not supported and what other protocols are supported by that server.

Reference RFC 7231, Section 6.6.6

Keyword Arguments:
 
  • description (str) – Human friendly description of the error.
  • title (str) – Error title (default ‘505 HTTP Version Not Supported’)
  • headers (dict) – A dict of header names and values to set.
  • href (str) – An href that can be used for more information.
exception luxon.exceptions.JSONDecodeError(message)[source]

JSON Decode Error.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.MultipleOblectsReturned(message)[source]

Multiple Objects Returned.

This error is raised when multiple objects are returned when expecting one.

Parameters:message (str) – Reason for error.
exception luxon.exceptions.NoContextError(message)[source]

No Context Error.

This error is raised when an operation is performed outside of the required environment/context.

Parameters:message (str) – Reason for context error.
exception luxon.exceptions.NotFoundError(message)[source]

Not Found.

This error indicates when a specific resource is not found. The message arguement can be used to describe what has not been found.

Parameters:message (str) – Representation of resource not found.
exception luxon.exceptions.PoolExhausted(pool_name, max_size)[source]

Pool Exhausted Error.

Exception that is raised when attempting to create/retrieve a connector object from a pool after the pool limit has been reached.

Parameters:
  • pool_name (str) – Identity of pool.
  • max_size (str) – Overflow + Pool Size Limit.
exception luxon.exceptions.SQLDataError[source]

Exception raised for errors that are due to problems with the processed data like division by zero, numeric value out of range, etc.

exception luxon.exceptions.SQLDatabaseError[source]

Exception raised for errors that are related to the database.

exception luxon.exceptions.SQLError[source]

Exception related to operation with MySQL.

exception luxon.exceptions.SQLIntegrityError[source]

Exception raised when the relational integrity of the database is affected, e.g. a foreign key check fails, duplicate key, etc.

exception luxon.exceptions.SQLInterfaceError[source]

Exception raised for errors that are related to the database interface rather than the database itself.

exception luxon.exceptions.SQLInternalError[source]

Exception raised when the database encounters an internal error, e.g. the cursor is not valid anymore, the transaction is out of sync, etc.

exception luxon.exceptions.SQLNotSupportedError[source]

Exception raised in case a method or database API was used which is not supported by the database, e.g. requesting a .rollback() on a connection that does not support transaction or has transactions turned off.

exception luxon.exceptions.SQLOperationalError[source]

Exception raised for errors that are related to the database’s operation and not necessarily under the control of the programmer, e.g. an unexpected disconnect occurs, the data source name is not found, a transaction could not be processed, a memory allocation error occurred during processing, etc.

exception luxon.exceptions.SQLProgrammingError[source]

Exception raised for programming errors, e.g. table not found or already exists, syntax error in the SQL statement, wrong number of parameters specified, etc.

exception luxon.exceptions.SQLWarning[source]

Exception raised for important warnings like data truncations while inserting, etc.

exception luxon.exceptions.TokenExpiredError[source]

Token Expired Error.

This error indicates that the server understood the request but refuses to authorize it.

Parameters:message (str) – Reason for access denied.
exception luxon.exceptions.TokenMissingError[source]

Token Missing Error.

This error indicates that the server understood the request but refuses to authorize it.

Parameters:message (str) – Reason for access denied.
exception luxon.exceptions.ValidationError(message)[source]

Validation Error.

During a process it was unable to validate information with the context of the request. Message arguement may contain a detailed response.

Parameters:message (str) – Reason for validation error.