changes_stream2/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
    #[error("Could not parse the url")]
    InvalidUrl(#[from] url::ParseError),
    #[error("Request failed")]
    RequestFailed(#[from] reqwest::Error),
    #[error("Server answered with non-ok status: {status}. body: {body}")]
    InvalidResponse {
        status: reqwest::StatusCode,
        body: String,
    },
    #[error("Could not parse server response: {json}")]
    ParsingFailed {
        #[source]
        error: serde_json::Error,
        json: String,
    },
}