Errors¶
Every failure raises a typed exception from storix.errors. They all inherit
StorageError, so you can catch storage failures wholesale, and the path-related
ones also inherit their stdlib counterpart, so idiomatic handlers keep working.
from storix.errors import StorageError, PathNotFoundError
try:
fs.cat("/missing.txt")
except PathNotFoundError as exc:
print(exc.path) # the offending path, as data
except StorageError:
... # any storix failure
Hierarchy¶
StorageError # base for everything storix raises
├── PathError # concerns a single path; carries `.path`
│ ├── PathNotFoundError # also a FileNotFoundError
│ ├── AlreadyExistsError # also a FileExistsError
│ ├── NotADirectoryError # also a NotADirectoryError
│ ├── IsADirectoryError # also an IsADirectoryError
│ ├── PermissionDeniedError # also a PermissionError
│ └── DirectoryNotEmptyError # also an OSError
├── UnsupportedOperationError # backend lacks the requested capability
├── NonRemovableLayerError # without_layer() asked to strip a boundary
└── ConfigurationError # the factory cannot build what was asked
Notes¶
PathErrorsubclasses carry the offending path as.path(aStorixPath) plus.filenameand.errno, mirroringOSError. In a sandbox, the path is the virtual one, so errors never leak the real prefix.UnsupportedOperationErrornames the missing capability (for example passingcontent_type=to a local backend, orurl()on a backend withoutpresigned_urls).NonRemovableLayerErroris raised bywithout_layerwhen a matched layer setsremovable = False, notablySandboxLayer.from_os_error(exc, path)translates a rawOSErrorinto this taxonomy; it is the boundary helper filesystem-backed backends use.