use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
Workflow(#[from] taquba_workflow::Error),
#[error(transparent)]
Queue(#[from] taquba::Error),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("payload encode error: {0}")]
Encode(#[from] rmp_serde::encode::Error),
#[error("bulk run failed: {failed}/{total} items failed, over the {threshold:.1}% threshold")]
FailureThresholdExceeded {
failed: usize,
total: usize,
threshold: f64,
},
}
pub type Result<T> = std::result::Result<T, Error>;