summaryrefslogtreecommitdiffstats
path: root/src/error.rs
blob: 97c14e97cf1ebaabddac9b1abfab90fe26f6ad1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use redis::RedisError;
use serde_json::Error as SerdeError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum AirceptionError {
    #[error("redis: {source}")]
    Redis {
        #[from]
        source: RedisError,
    },
    #[error("serde: {source}")]
    Serde {
        #[from]
        source: SerdeError,
    },
    #[error("tdlib-rs error: {source}")]
    Internal {
        #[from]
        source: tdlib_rs::Error,
    },
}

pub type AirceptionResult<T> = Result<T, AirceptionError>;