src/pqc_agent_wallet/errors.py
| 1 | """Exception hierarchy for pqc-agent-wallet.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | |
| 6 | class WalletError(Exception): |
| 7 | """Base for all wallet errors.""" |
| 8 | |
| 9 | |
| 10 | class WalletLockedError(WalletError): |
| 11 | """Operation requires an unlocked wallet; call unlock() first.""" |
| 12 | |
| 13 | |
| 14 | class CredentialNotFoundError(WalletError): |
| 15 | """Named credential does not exist in the wallet.""" |
| 16 | |
| 17 | |
| 18 | class InvalidPassphraseError(WalletError): |
| 19 | """Passphrase failed to derive a valid unlock key.""" |
| 20 | |
| 21 | |
| 22 | class TamperedWalletError(WalletError): |
| 23 | """Wallet file signature or MAC failed verification.""" |
| 24 | |
| 25 | |
| 26 | class WalletFormatError(WalletError): |
| 27 | """Wallet file is malformed or of incompatible version.""" |
| 28 | |