wepay.exceptions Module

exception wepay.exceptions.WePayError(error, error_code, error_description)[source]

Raised whenever WePay API call was not successfull. WePay API Errors Documentation

error

Generic error category. Returned by WePay.

error_code

A specific “error_code” that you can use to program responses to errors. Returned by WePay.

error_description

A human readable error_description that explains why the error happened. Returned by WePay.

exception wepay.exceptions.WePayHTTPError(http_error, status_code, error=None, error_code=None, error_description=None)[source]

This is a base http error

status_code

Error Code as specified by RFC 2616.

http_error

Instance of urllib.error.HTTPError or requests.exceptions.HTTPError, depending on the library you chose.

exception wepay.exceptions.WePayClientError(http_error, status_code, error=None, error_code=None, error_description=None)[source]

This is a 4xx type error, which, most of the time, carries important error information about the object of interest.

exception wepay.exceptions.WePayServerError(http_error, status_code, error=None, error_code=None, error_description=None)[source]

This is a 5xx type error, which, most of the time, means there is an error in implemetation or some unknown WePay Error, in latter case there is a chance there will be no error, error_code or error_description from WePay. It is recommended this exception is to be ignored or handled separatly in production.

exception wepay.exceptions.WePayConnectionError(error)[source]

Raised in case there is a problem connecting to WePay servers, for instance when request times out.

error

Original exception raised by urllib or requests library. It will be either urllib.error.URLError or a subclass of requests.exceptions.RequestExeption. See their corresponding documentation if necessary.