gfwapiclient.exceptions.base

Global Fishing Watch (GFW) API Python Client - Base Exceptions.

Module Contents

Data

API

gfwapiclient.exceptions.base.__all__ = ['GFWAPIClientError']
gfwapiclient.exceptions.base.GFW_API_CLIENT_ERROR_MESSAGE: Final[str] = 'An error occurred.'
exception gfwapiclient.exceptions.base.GFWAPIClientError(message: Optional[str] = None)

Bases: Exception

Base exception for errors related to the GFW API client.

This exception serves as the parent class for all errors raised by the gfwapiclient package, making it useful for broad exception handling.

Attributes:
message (str):

The error message.

Example:

```python from gfwapiclient.exceptions import GFWAPIClientError

try:

raise GFWAPIClientError(“An unexpected error occurred.”)

except GFWAPIClientError as exc:

print(f”GFW Exception: {exc}”)

```

Initialization

Initialize a new GFWAPIClientError exception.

Args:
message (Optional[str], default=None):

Error message describing the exception.

__str__() str

Return a string representation of the error.

__repr__() str

Return the canonical string representation of the error.