mirror of
https://git.asonix.dog/asonix/background-jobs.git
synced 2024-11-26 14:00:59 +00:00
21 lines
446 B
Rust
21 lines
446 B
Rust
use failure::Fail;
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
#[derive(Clone, Debug, Fail)]
|
|
pub enum Error {
|
|
#[fail(display = "Error in database: {}", _0)]
|
|
Sled(#[cause] sled::Error),
|
|
|
|
#[fail(display = "Failed to deserialize data")]
|
|
Deserialize,
|
|
|
|
#[fail(display = "Failed to serialize data")]
|
|
Serialize,
|
|
}
|
|
|
|
impl From<sled::Error> for Error {
|
|
fn from(e: sled::Error) -> Self {
|
|
Error::Sled(e)
|
|
}
|
|
}
|