1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::string::FromUtf8Error;
use eventsource_stream::EventStreamError;
use reqwest::header::InvalidHeaderValue;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("An error occurred when processing a request: {0}")]
ClientError(#[from] reqwest::Error),
#[error("Invalid configuration provided: {0}")]
InvalidConfiguration(#[from] InvalidHeaderValue),
#[error("Parsing error has occurred: {0}")]
ParsingError(String),
#[error("Failed to (de)serialize data: {0}")]
SerdeError(#[from] serde_json::Error),
#[error("Failed to parse string from UTF-8: {0}")]
StringError(#[from] FromUtf8Error),
#[error("An error occurred while processing request: {0}")]
BackendError(String),
#[error("An error occurred while iterating over stream: {0}")]
StreamError(#[from] EventStreamError<reqwest::Error>),
}