# granite_assets.exceptions

All exceptions raised by granite-assets derive from `AssetError`, so you can catch the base class for general handling and subclasses for specific cases.

Exceptions raised by granite-assets repositories.

exception granite_assets.exceptions.AssetError

  Bases: `Exception`

  Base exception for all granite-assets errors.

exception granite_assets.exceptions.AssetNotFoundError(key: str)

  Bases: `AssetError`

  Raised when an asset key does not exist in the repository.

  __init__(key: str) → None

exception granite_assets.exceptions.AssetAccessNotSupportedError(backend: str, operation: str)

  Bases: `AssetError`

  Raised when the requested URL type is not supported by this backend.

  For example, `build_upload_url` on a local-nginx repository will raise this because there is no built-in mechanism to generate a pre-signed upload endpoint from a plain filesystem.

  __init__(backend: str, operation: str) → None

exception granite_assets.exceptions.AssetConfigurationError

  Bases: `AssetError`

  Raised when a repository is misconfigured (missing field, bad value, etc.).