| 1 | pub type Result<T> = std::result::Result<T, Error>; |
| 2 | |
| 3 | #[derive(Debug, thiserror::Error)] |
| 4 | pub enum Error { |
| 5 | #[error(transparent)] |
| 6 | Session(#[from] session::Error), |
| 7 | #[error("unexpected Graph answer: {0}")] |
| 8 | Parse(#[from] serde_json::Error), |
| 9 | #[error("refusing to follow a next link outside Graph")] |
| 10 | ForeignNextLink, |
| 11 | #[error("cannot decode a binary answer: {0}")] |
| 12 | Decode(String), |
| 13 | #[error("you are not a member of this chat")] |
| 14 | NotAMember, |
| 15 | #[error("cannot upload an empty file")] |
| 16 | EmptyUpload, |
| 17 | #[error("upload failed: {0}")] |
| 18 | Upload(String), |
| 19 | /// The file is in the drive, but the organization refused the share (`sharingFailed`) |
| 20 | /// or nobody in the chat could be invited. |
| 21 | #[error("sharing denied: {0}")] |
| 22 | SharingDenied(String), |
| 23 | #[error("download failed: {0}")] |
| 24 | Download(String), |
| 25 | } |