Skip to main content

Error Handling

Both TypeScript and Python SDKs provide comprehensive error handling capabilities. The base error class is FathomError for both SDKs.

Basic Error Handling

Handle Specific Status Codes

Error Classes

Primary error:
  • FathomError: The base class for HTTP error responses.
Network errors (TypeScript):
  • ConnectionError: HTTP client was unable to make a request to a server.
  • RequestTimeoutError: HTTP request timed out due to an AbortSignal signal.
  • RequestAbortedError: HTTP request was aborted by the client.
  • InvalidRequestError: Any input used to create a request is invalid.
  • UnexpectedClientError: Unrecognised or unexpected error.
Network errors (Python):
  • httpx.RequestError: Base class for request errors.
  • httpx.ConnectError: HTTP client was unable to make a request to a server.
  • httpx.TimeoutException: HTTP request timed out.
Inherit from FathomError:
  • ResponseValidationError: Type mismatch between the response data and the expected model structure.