Custom Exceptions

Special Exception subclasses

exception xbox.webapi.common.exceptions.XboxException[source]

Bases: Exception

Base exception for all Xbox exceptions to subclass

exception xbox.webapi.common.exceptions.AuthenticationException[source]

Bases: XboxException

Raised when logging in fails, likely due to incorrect auth credentials

exception xbox.webapi.common.exceptions.TwoFactorAuthRequired(message, server_data)[source]

Bases: XboxException

__init__(message, server_data)[source]

Raised when 2FA is required

Parameters:
  • message (str) – Exception message

  • server_data (dict) – Server data dict, extracted js object from windows live auth request

exception xbox.webapi.common.exceptions.InvalidRequest(message, response)[source]

Bases: XboxException

__init__(message, response)[source]

Raised when something is wrong with the request

Parameters:
  • message (str) – error message returned by the server

  • response (requests.Response) – Instance of requests.Response

exception xbox.webapi.common.exceptions.NotFoundException[source]

Bases: XboxException

Any exception raised due to a resource being missing will subclass this