Exceptions

exception lanyard.http.exception.HTTPError(method, url, message)[source]

Base exception for all HTTP-related errors.

Parameters:
  • method (str) – Method of the request.

  • url (str) – URL of the request.

  • message (str) – Error message.

Return type:

None

exception lanyard.http.exception.HTTPResponseError(method, url, status_code, content)[source]

Base exception for all HTTP-related response errors.

Parameters:
  • method (str) – Method of HTTP response.

  • url (str) – URL of HTTP response.

  • status_code (int) – HTTP status code of HTTP response.

  • content (Any) – Content of HTTP response.

Return type:

None

exception lanyard.http.exception.HTTPClientError(method, url, status_code, content)[source]

Exception for HTTP related client errors (4xx).

Base exception for all HTTP-related response errors.

Parameters:
  • method (str) – Method of HTTP response.

  • url (str) – URL of HTTP response.

  • status_code (int) – HTTP status code of HTTP response.

  • content (Any) – Content of HTTP response.

Return type:

None

exception lanyard.http.exception.HTTPServerError(method, url, status_code, content)[source]

Exception for HTTP related server errors (5xx).

Base exception for all HTTP-related response errors.

Parameters:
  • method (str) – Method of HTTP response.

  • url (str) – URL of HTTP response.

  • status_code (int) – HTTP status code of HTTP response.

  • content (Any) – Content of HTTP response.

Return type:

None

exception lanyard.http.exception.UnauthorizedError(method, url, status_code, content)[source]

Exception for HTTP client error related to “unauthorized” (401) error.

Base exception for all HTTP-related response errors.

Parameters:
  • method (str) – Method of HTTP response.

  • url (str) – URL of HTTP response.

  • status_code (int) – HTTP status code of HTTP response.

  • content (Any) – Content of HTTP response.

Return type:

None

exception lanyard.http.exception.NotFoundError(method, url, status_code, content)[source]

Exception for HTTP client error related to “not found” (404) error.

Base exception for all HTTP-related response errors.

Parameters:
  • method (str) – Method of HTTP response.

  • url (str) – URL of HTTP response.

  • status_code (int) – HTTP status code of HTTP response.

  • content (Any) – Content of HTTP response.

Return type:

None