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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use std::io;
use ringline_h2::H2Error;
/// Errors produced by the HTTP client.
#[derive(Debug, thiserror::Error)]
pub enum HttpError {
/// The connection was closed unexpectedly.
#[error("connection closed")]
ConnectionClosed,
/// HTTP/2 framing error.
#[error("h2 error: {0}")]
H2(#[from] H2Error),
/// I/O error.
#[error("io error: {0}")]
Io(#[from] io::Error),
/// Invalid URL or path.
#[error("invalid url: {0}")]
InvalidUrl(String),
/// Response parsing error.
#[error("parse error")]
Parse,
/// Request timed out.
#[error("timeout")]
Timeout,
/// H2 flow control blocked and could not be resolved.
#[error("flow control error")]
FlowControl,
/// All connections in a pool failed.
#[error("all connections failed")]
AllConnectionsFailed,
/// Protocol error (unexpected event, bad state).
#[error("protocol error: {0}")]
Protocol(String),
/// Decompression error.
#[error("decompression error: {0}")]
Decompress(String),
}