Exceptions

The GPP Client defines a hierarchy of exceptions to allow users to handle failures in a predictable and structured way. All exceptions inherit from GPPError.

Most users will only need to catch high-level categories such as GPPAuthError or GPPNetworkError. More advanced error handling can use the full exception tree.

API Reference

Exceptions for the GPP client library.

exception gpp_client.exceptions.GPPAuthError[source]

Bases: GPPError

Raised when authentication fails (missing token, expired token, unauthorized).

exception gpp_client.exceptions.GPPClientError[source]

Bases: GPPError

Raised when there is a client-side error.

exception gpp_client.exceptions.GPPError[source]

Bases: Exception

Base class for all exceptions raised by the GPP client library.

exception gpp_client.exceptions.GPPNetworkError[source]

Bases: GPPError

Raised when there is a network-related error.

exception gpp_client.exceptions.GPPResponseError(status_code: int, message: str)[source]

Bases: GPPError

Raised when GPP returns a non-successful HTTP or GraphQL response.

This includes: - 5xx server errors - 4xx errors (if you choose to treat them as exceptional) - Valid GraphQL response with an ‘errors’ field

Parameters:
  • status_code (int) – The HTTP status code returned by GPP.

  • message (str) – The error message or description.

exception gpp_client.exceptions.GPPRetryableError[source]

Bases: GPPError

Raised for errors that may be transient and worth retrying.

exception gpp_client.exceptions.GPPTimeoutError[source]

Bases: GPPNetworkError

Raised when a network operation times out.

exception gpp_client.exceptions.GPPValidationError[source]

Bases: GPPClientError

Raised when there is a validation error (e.g., invalid input data).