hippius 0.2.4__py3-none-any.whl → 0.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hippius_sdk/errors.py ADDED
@@ -0,0 +1,77 @@
1
+ """
2
+ Custom exceptions for the Hippius SDK.
3
+ """
4
+
5
+
6
+ class HippiusError(Exception):
7
+ """Base exception for all Hippius-specific errors."""
8
+
9
+ pass
10
+
11
+
12
+ class HippiusSubstrateError(HippiusError):
13
+ """Base exception for Substrate-related errors."""
14
+
15
+ pass
16
+
17
+
18
+ class HippiusIPFSError(HippiusError):
19
+ """Base exception for IPFS-related errors."""
20
+
21
+ pass
22
+
23
+
24
+ # Specific blockchain errors
25
+ class HippiusNotFoundError(HippiusSubstrateError):
26
+ """Raised when a resource is not found on the blockchain."""
27
+
28
+ pass
29
+
30
+
31
+ class HippiusAlreadyDeletedError(HippiusSubstrateError):
32
+ """Raised when trying to delete a file that's already deleted from the blockchain."""
33
+
34
+ pass
35
+
36
+
37
+ class HippiusSubstrateConnectionError(HippiusSubstrateError):
38
+ """Raised when there's an issue connecting to the Substrate node."""
39
+
40
+ pass
41
+
42
+
43
+ class HippiusSubstrateAuthError(HippiusSubstrateError):
44
+ """Raised when there's an authentication issue with the Substrate client."""
45
+
46
+ pass
47
+
48
+
49
+ class HippiusFailedSubstrateDelete(HippiusSubstrateError):
50
+ """Raised when deletion from blockchain storage fails."""
51
+
52
+ pass
53
+
54
+
55
+ # IPFS-specific errors
56
+ class HippiusIPFSConnectionError(HippiusIPFSError):
57
+ """Raised when there's an issue connecting to IPFS."""
58
+
59
+ pass
60
+
61
+
62
+ class HippiusFailedIPFSUnpin(HippiusIPFSError):
63
+ """Raised when unpinning from IPFS fails."""
64
+
65
+ pass
66
+
67
+
68
+ class HippiusMetadataError(HippiusIPFSError):
69
+ """Raised when there's an issue with the metadata file."""
70
+
71
+ pass
72
+
73
+
74
+ class HippiusInvalidCIDError(HippiusIPFSError):
75
+ """Raised when an invalid CID is provided."""
76
+
77
+ pass