BlueGit

ict rusty-teams

Files

rusty-teams / crates / core / src / error.rs

error.rs

Initial commit
metis Daniel Däschle · pushed by metis · 7 weeks ago
06e0ae51 History
error.rs 698 B Download Raw
1pub type Result<T> = std::result::Result<T, Error>;
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5 #[error(transparent)]
6 Graph(#[from] graph::Error),
7 #[error(transparent)]
8 Store(#[from] store::Error),
9 #[error("folder service: {0}")]
10 Folders(String),
11 #[error("unknown conversation {0}")]
12 UnknownConversation(String),
13 #[error("{0} is not supported yet")]
14 Unsupported(&'static str),
15}
16
17impl From<chatsvc::Error> for Error {
18 fn from(error: chatsvc::Error) -> Self {
19 match error {
20 chatsvc::Error::Session(inner) => Error::Graph(graph::Error::Session(inner)),
21 other => Error::Folders(other.to_string()),
22 }
23 }
24}