Exceptions API
The exceptions module provides custom exceptions for the USDA FDC client.
FdcApiError
FdcAuthError
- class usda_fdc.exceptions.FdcAuthError[source]
Bases:
FdcApiErrorException raised when authentication fails.
FdcRateLimitError
- class usda_fdc.exceptions.FdcRateLimitError[source]
Bases:
FdcApiErrorException raised when the API rate limit is exceeded.
FdcTimeoutError
- class usda_fdc.exceptions.FdcTimeoutError[source]
Bases:
FdcApiErrorException raised when a request to the FDC API times out.
Distinct from a generic FdcApiError so callers can tell “slow” from “broken” — a timeout is usually worth retrying, a 400 is not.
FdcValidationError
- class usda_fdc.exceptions.FdcValidationError[source]
Bases:
FdcApiErrorException raised when input validation fails.
FdcResourceNotFoundError
- class usda_fdc.exceptions.FdcResourceNotFoundError[source]
Bases:
FdcApiErrorException raised when a requested resource is not found.