-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror.rs
More file actions
36 lines (31 loc) · 1.23 KB
/
error.rs
File metadata and controls
36 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use std::{array::TryFromSliceError, num::TryFromIntError};
use thiserror::Error;
pub type RisklessResult<T> = Result<T, RisklessError>;
#[derive(Error, Debug)]
pub enum RisklessError {
/// Generic Error for arbitrary errors that are generally not classified but should still convey information.
#[error("{0}")]
Generic(String),
#[error("unknown data store error")]
Unknown,
// Inferred
#[error("Sender Error for Tokio MPSC {0}")]
TokioMpscSenderError(String),
#[error("ObjectStore Error")]
ObjectStoreError(#[from] object_store::Error),
#[error("TryFromInt Conversion Error")]
TryFromIntConversionError(#[from] TryFromIntError),
#[error("TryFromSlice Conversion Error")]
TryFromSliceConversionrror(#[from] TryFromSliceError),
#[error("IO Error")]
IoError(#[from] std::io::Error),
#[error("Tokio Oneshot Channel Receive Error")]
TokioOneshotChannelRecvError(#[from] tokio::sync::oneshot::error::RecvError),
#[error("Uuid Error")]
UuidError(#[from] uuid::Error),
}
impl<T> From<tokio::sync::mpsc::error::SendError<T>> for RisklessError {
fn from(value: tokio::sync::mpsc::error::SendError<T>) -> Self {
RisklessError::TokioMpscSenderError(value.to_string())
}
}