10.2.5. Exceptions for all Authentication Methods

Exceptions and warnings for pytan3.auth_methods.

exception pytan3.auth_methods.exceptions.ModuleError[source]

Bases: pytan3.exceptions.PyTanError

Parent of all exceptions for pytan3.auth_methods.

Thrown by:
exception pytan3.auth_methods.exceptions.ModuleWarning[source]

Bases: pytan3.exceptions.PyTanWarning

Parent of all warnings for pytan3.auth_methods.

Thrown by:

exception pytan3.auth_methods.exceptions.MethodError(auth_method, info=None, response=None)[source]

Bases: pytan3.auth_methods.exceptions.ModuleError

Parent of all pytan3.auth_methods.AuthMethod exceptions.

Thrown by:

msg = 'Authentication Method Error!'

str – Error message to use in exception.

__init__(auth_method, info=None, response=None)[source]

Constructor.

Parameters:
  • auth_method (pytan3.auth_methods.AuthMethod) – Object where exception was thrown from.
  • info (str, optional) –

    Additional error info message to show.

    Defaults to: None.

  • response (requests.Response, optional) –

    Response associated with this exception, if any.

    Defaults to: None.

error = None

str – Error message that was thrown.

exception pytan3.auth_methods.exceptions.InvalidToken(auth_method, info=None, response=None)[source]

Bases: pytan3.auth_methods.exceptions.MethodError

Thrown when validate_token fails.

Thrown by:
msg = 'Supplied token is invalid!'

str – Error message to use in exception.

exception pytan3.auth_methods.exceptions.NotLoggedInError(auth_method, info=None, response=None)[source]

Bases: pytan3.auth_methods.exceptions.MethodError

Thrown when logout called before login.

Thrown by:
msg = 'Not logged in, unable to logout/validate token. Must login first!'

str – Error message to use in exception.

exception pytan3.auth_methods.exceptions.LoginError(auth_method, info=None, response=None)[source]

Bases: pytan3.auth_methods.exceptions.MethodError

Thrown when login response has any status_code other than 200.

Thrown by:
msg = 'Login failed. Response status code is not 200!'

str – Error message to use in exception.

exception pytan3.auth_methods.exceptions.LogoutError(auth_method, info=None, response=None)[source]

Bases: pytan3.auth_methods.exceptions.MethodError

Thrown when logout fails.

Thrown by:
msg = 'Logout failed. Verify the supplied credentials!'

str – Error message to use in exception.