Skip to content

Commit

Permalink
feat: multi-action transaction support with retries
Browse files Browse the repository at this point in the history
  • Loading branch information
bittermandel committed Oct 5, 2024
1 parent 1b3cc9c commit c73cf4c
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 168 deletions.
23 changes: 9 additions & 14 deletions crates/valv/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
use foundationdb::FdbBindingError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ValvError {
#[error("IO error")]
Io(#[from] std::io::Error),

#[error("Database error")]
Database(#[from] foundationdb::FdbError),

#[error("Transaction commit error")]
TransactionCommitError(#[from] foundationdb::TransactionCommitError),

#[error("Directory error")]
DirectoryError(foundationdb::directory::DirectoryError),

#[error("TuplePacking error")]
TuplePacking(#[from] foundationdb::tuple::PackError),

#[error("Prost decode error")]
Decode(#[from] prost::DecodeError),
#[error("Storage error")]
Storage(#[from] crate::storage::errors::StorageError),

#[error("BoringSSL error")]
BoringSSL(#[from] boring::error::ErrorStack),
Expand All @@ -43,3 +32,9 @@ pub enum ValvError {
}

pub type Result<T> = std::result::Result<T, ValvError>;

impl From<ValvError> for FdbBindingError {
fn from(error: ValvError) -> Self {
FdbBindingError::CustomError(Box::new(error))
}
}
Loading

0 comments on commit c73cf4c

Please sign in to comment.