Implement recoverable exact result deletion
This commit is contained in:
parent
cdeef3cc1a
commit
791e00f4c0
1 changed files with 2521 additions and 1 deletions
25
crates/remora-deletion/src/error.rs
Normal file
25
crates/remora-deletion/src/error.rs
Normal 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))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue