Custom Exceptions

Special Exception subclasses

exception xbox.webapi.common.exceptions.XboxException

Bases: Exception

Base exception for all Xbox exceptions to subclass

exception xbox.webapi.common.exceptions.AuthenticationException

Bases: xbox.webapi.common.exceptions.XboxException

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

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

Bases: xbox.webapi.common.exceptions.XboxException

__init__(message, server_data)

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)

Bases: xbox.webapi.common.exceptions.XboxException

__init__(message, response)

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

Bases: xbox.webapi.common.exceptions.XboxException

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