BlueGit

ict rusty-teams

Files

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

error.rs

error.rs 773 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("cannot write the file: {0}")]
10 Io(#[from] std::io::Error),
11 #[error("folder service: {0}")]
12 Folders(String),
13 #[error("unknown conversation {0}")]
14 UnknownConversation(String),
15 #[error("{0} is not supported yet")]
16 Unsupported(&'static str),
17}
18
19impl From<chatsvc::Error> for Error {
20 fn from(error: chatsvc::Error) -> Self {
21 match error {
22 chatsvc::Error::Session(inner) => Error::Graph(graph::Error::Session(inner)),
23 other => Error::Folders(other.to_string()),
24 }
25 }
26}