Skip to content

Exceptions

All exceptions inherit from FileStoreError.

Hierarchy

Exception Parent Raised When
FileStoreError Exception Base — catch to handle any filestore error
ConfigurationError FileStoreError Invalid setup (no/duplicate fields, engine class instead of instance, missing bucket/container)
ValidationError FileStoreError File fails a size check
StorageError FileStoreError Backend cannot persist, delete, or presign
MissingDependencyError FileStoreError Cloud SDK extra not installed
NotSupportedError FileStoreError Engine doesn't support the operation (e.g. presigning on LocalEngine)

Usage

from filestore import ConfigurationError, FileStoreError, NotSupportedError

# Catch all filestore errors
try:
    storage = FileStore("file", engine=bad_engine)
except FileStoreError as err:
    print(f"Filestore error: {err}")

# Catch specific errors
try:
    url = await engine.presign_upload("a.png")
except NotSupportedError:
    print("This engine cannot presign — proxy the upload instead")

Note

Validation failures during upload do not raise exceptions out of the dependency. They are captured in FileData.error and Store.errors. Direct engine calls (save, delete, presign_*) do raise.