Coverage for src/polystore/exceptions.py: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-03 06:58 +0000

1""" 

2Exceptions for polystore. 

3 

4This module defines exceptions for storage operations and backend management. 

5""" 

6 

7 

8class StorageError(Exception): 

9 """Base exception for storage operations.""" 

10 pass 

11 

12 

13class StorageResolutionError(StorageError): 

14 """Raised when a storage key cannot be resolved to a valid path.""" 

15 pass 

16 

17 

18class BackendNotFoundError(StorageError): 

19 """Raised when a backend is not found in the registry.""" 

20 pass 

21 

22 

23class UnsupportedFormatError(StorageError): 

24 """Raised when a file format is not supported.""" 

25 pass 

26 

27 

28class ImageLoadError(RuntimeError): 

29 """Raised when image loading fails.""" 

30 pass 

31 

32 

33class ImageSaveError(RuntimeError): 

34 """Raised when image saving fails.""" 

35 pass 

36 

37 

38class StorageWriteError(RuntimeError): 

39 """Raised when writing to storage fails.""" 

40 pass 

41 

42 

43class MetadataNotFoundError(ValueError): 

44 """Raised when required metadata files cannot be found.""" 

45 pass 

46 

47 

48class PathMismatchError(ValueError): 

49 """Raised when a path scheme doesn't match the expected scheme for a backend.""" 

50 pass 

51 

52 

53class VFSTypeError(TypeError): 

54 """Raised when a type error occurs in the VFS boundary.""" 

55 pass