use thiserror::Error;
#[derive(Debug, Error)]
pub enum ClaimLedgerError {
#[error("claim not found: {0}")]
ClaimNotFound(String),
#[error("support judgment not found: {0}")]
SupportJudgmentNotFound(String),
#[error("evidence bundle not found: {0}")]
EvidenceBundleNotFound(String),
#[error("contradiction not found: {0}")]
ContradictionNotFound(String),
#[error("invalid support state transition: {0}")]
InvalidSupportTransition(String),
#[error("supported admission requires proof payload or proof debt waiver")]
MissingProofPayload,
#[error("ledger verification failed: {0}")]
LedgerCorrupt(String),
#[error("serialization error: {0}")]
SerializationError(String),
#[error("missing required input reference: {0}")]
MissingInputRef(String),
}
impl ClaimLedgerError {
pub fn kind(&self) -> &'static str {
match self {
Self::ClaimNotFound(_) => "claim_not_found",
Self::SupportJudgmentNotFound(_) => "support_judgment_not_found",
Self::EvidenceBundleNotFound(_) => "evidence_bundle_not_found",
Self::ContradictionNotFound(_) => "contradiction_not_found",
Self::InvalidSupportTransition(_) => "invalid_support_transition",
Self::MissingProofPayload => "missing_proof_payload",
Self::LedgerCorrupt(_) => "ledger_corrupt",
Self::SerializationError(_) => "serialization_error",
Self::MissingInputRef(_) => "missing_input_ref",
}
}
}