Skip to content

Exceptions

pyfamilysafety.exceptions.HttpException

HttpException(*args)

Bases: Exception

Base exception for HTTP errors from the Family Safety API.

Raised by :meth:pyfamilysafety.api.FamilySafetyAPI.send_request for non-success status codes not mapped to a specific subclass.

Source code in pyfamilysafety/exceptions.py
10
11
def __init__(self, *args: object) -> None:
    super().__init__(*args)

pyfamilysafety.exceptions.Unauthorized

Unauthorized()

Bases: HttpException

HTTP 401 or failed token exchange.

Raised when authentication fails during login, refresh, or API calls.

Source code in pyfamilysafety/exceptions.py
19
20
def __init__(self) -> None:
    super().__init__("HTTP Unauthorized")

pyfamilysafety.exceptions.RequestDenied

RequestDenied(message='HTTP Access Denied')

Bases: HttpException

HTTP 403 access denied.

Raised when the authenticated user lacks permission for the requested action.

Source code in pyfamilysafety/exceptions.py
28
29
def __init__(self, message="HTTP Access Denied") -> None:
    super().__init__(message)

pyfamilysafety.exceptions.AggregatorException

AggregatorException()

Bases: HttpException

Transient Microsoft aggregator failure (HTTP 500).

Raised when the response body contains the known aggregator error message. :meth:pyfamilysafety.FamilySafety.update catches this and skips the refresh.

Source code in pyfamilysafety/exceptions.py
38
39
def __init__(self) -> None:
    super().__init__("An upstream aggregator error occured.")