Implement recoverable exact result deletion

This commit is contained in:
ms2k 2026-07-17 19:28:28 +09:00
commit 791e00f4c0

View file

@ -0,0 +1,25 @@
use remora_durable::DurableError;
#[derive(Debug, thiserror::Error)]
pub enum DeletionError {
#[error("resource not found")]
NotFound,
#[error("job is not terminal")]
NotTerminal,
#[error("hard deletion has already started")]
HardDeleteStarted,
#[error("committed result inventory is corrupt")]
CorruptInventory,
#[error("deletion claim is no longer authoritative")]
ClaimLost,
#[error("invalid deletion configuration: {0}")]
InvalidConfig(String),
#[error("durable deletion operation failed: {0}")]
Durable(#[from] DurableError),
}
impl From<sqlx::Error> for DeletionError {
fn from(error: sqlx::Error) -> Self {
Self::Durable(DurableError::Database(error))
}
}