Conduit is a simple, fast and reliable chat server powered by Matrix https://conduit.rs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
900 B
37 lines
900 B
|
6 years ago
|
use thiserror::Error;
|
||
|
|
|
||
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
||
|
|
|
||
|
|
#[derive(Error, Debug)]
|
||
|
|
pub enum Error {
|
||
|
|
#[error("problem with the database")]
|
||
|
|
SledError {
|
||
|
|
#[from]
|
||
|
|
source: sled::Error,
|
||
|
|
},
|
||
|
|
#[error("tried to parse invalid string")]
|
||
|
|
StringFromBytesError {
|
||
|
|
#[from]
|
||
|
|
source: std::string::FromUtf8Error,
|
||
|
|
},
|
||
|
|
#[error("tried to parse invalid identifier")]
|
||
|
|
SerdeJsonError {
|
||
|
|
#[from]
|
||
|
|
source: serde_json::Error,
|
||
|
|
},
|
||
|
|
#[error("tried to parse invalid identifier")]
|
||
|
|
RumaIdentifierError {
|
||
|
|
#[from]
|
||
|
|
source: ruma_identifiers::Error,
|
||
|
|
},
|
||
|
|
#[error("tried to parse invalid event")]
|
||
|
|
RumaEventError {
|
||
|
|
#[from]
|
||
|
|
source: ruma_events::InvalidEvent,
|
||
|
|
},
|
||
|
|
#[error("bad request")]
|
||
|
|
BadRequest(&'static str),
|
||
|
|
#[error("problem in that database")]
|
||
|
|
BadDatabase(&'static str),
|
||
|
|
}
|