Exceptions API

The exceptions module provides custom exceptions for the USDA FDC client.

FdcApiError

class usda_fdc.exceptions.FdcApiError[source]

Bases: Exception

Base exception for all FDC API errors.

FdcAuthError

class usda_fdc.exceptions.FdcAuthError[source]

Bases: FdcApiError

Exception raised when authentication fails.

FdcRateLimitError

class usda_fdc.exceptions.FdcRateLimitError[source]

Bases: FdcApiError

Exception raised when the API rate limit is exceeded.

FdcValidationError

class usda_fdc.exceptions.FdcValidationError[source]

Bases: FdcApiError

Exception raised when input validation fails.

FdcResourceNotFoundError

class usda_fdc.exceptions.FdcResourceNotFoundError[source]

Bases: FdcApiError

Exception raised when a requested resource is not found.