Exceptions¶
- class toto.exceptions.TotoException(code, value)[source]¶
This class is used to return errors from Toto methods. TotoException.value is used to describe the exception and TotoException.code should be set to a status code that can be used to programmatically reference the exception. Toto’s error redirecting capabilities use code to look up the redirect URL.
Toto uses the following error codes internally:
- ERROR_SERVER = 1000
- ERROR_MISSING_METHOD = 1002
- ERROR_MISSING_PARAMS = 1003
- ERROR_NOT_AUTHORIZED = 1004
- ERROR_USER_NOT_FOUND = 1005
- ERROR_USER_ID_EXISTS = 1006
- ERROR_INVALID_SESSION_ID = 1007
- ERROR_INVALID_HMAC = 1008
- ERROR_INVALID_RESPONSE_HMAC = 1009
- ERROR_INVALID_USER_ID 1010