src/pqc_hypervisor_attestation/errors.py
| 1 | """Exception hierarchy for pqc-hypervisor-attestation.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | |
| 6 | class HypervisorAttestationError(Exception): |
| 7 | """Base exception for all pqc-hypervisor-attestation errors.""" |
| 8 | |
| 9 | |
| 10 | class InvalidRegionError(HypervisorAttestationError): |
| 11 | """Raised when a memory region is missing, malformed, or not registered.""" |
| 12 | |
| 13 | |
| 14 | class AttestationVerificationError(HypervisorAttestationError): |
| 15 | """Raised when an AttestationReport fails cryptographic verification.""" |
| 16 | |
| 17 | |
| 18 | class BackendError(HypervisorAttestationError): |
| 19 | """Raised when an attestation backend cannot service a request.""" |
| 20 | |
| 21 | |
| 22 | class UnknownBackendError(BackendError): |
| 23 | """Raised when a requested backend platform is not registered.""" |
| 24 | |
| 25 | |
| 26 | class RegionDriftError(AttestationVerificationError): |
| 27 | """Raised when a region's snapshot does not match its expected hash.""" |
| 28 | |