1#[derive(Debug, thiserror::Error)]
6pub enum Error {
7 #[error("[no-sentry] Illegal characters in request header '{0}'")]
8 RequestHeaderError(crate::HeaderName),
9
10 #[error("[no-sentry] Backend error: {0}")]
11 BackendError(String),
12
13 #[error("[no-sentry] Network error: {0}")]
14 NetworkError(String),
15
16 #[error("The rust-components network backend must be initialized before use!")]
17 BackendNotInitialized,
18
19 #[error("Backend already initialized.")]
20 SetBackendError,
21
22 #[error("[no-sentry] URL Parse Error: {0}")]
25 UrlError(#[source] url::ParseError),
26
27 #[error("[no-sentry] Validation error: URL does not use TLS protocol.")]
28 NonTlsUrl,
29}
30
31impl From<url::ParseError> for Error {
32 fn from(u: url::ParseError) -> Self {
33 Error::UrlError(u)
34 }
35}
36
37#[derive(thiserror::Error, Debug, Clone)]
43#[error("Error: {method} {url} returned {status}")]
44pub struct UnexpectedStatus {
45 pub status: u16,
46 pub method: crate::Method,
47 pub url: url::Url,
48}