src/pqc_content_provenance/errors.py
| 1 | """Exception hierarchy for PQC Content Provenance.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | |
| 6 | class ProvenanceError(Exception): |
| 7 | """Base exception for all content provenance errors.""" |
| 8 | |
| 9 | |
| 10 | class InvalidManifestError(ProvenanceError): |
| 11 | """Manifest structure is invalid or malformed.""" |
| 12 | |
| 13 | |
| 14 | class SignatureVerificationError(ProvenanceError): |
| 15 | """Cryptographic verification of a manifest signature failed.""" |
| 16 | |
| 17 | |
| 18 | class ChainBrokenError(ProvenanceError): |
| 19 | """A provenance chain link is missing or invalid.""" |
| 20 | |
| 21 | |
| 22 | class UnknownAssertionError(ProvenanceError): |
| 23 | """An assertion type is unknown or unregistered.""" |
| 24 | |
| 25 | |
| 26 | class ContentHashMismatchError(SignatureVerificationError): |
| 27 | """The content's actual hash doesn't match the manifest's claimed hash.""" |
| 28 | |