Skip to main content

http_type/request/
enum.rs

1use crate::*;
2
3#[derive(Clone, Debug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
4pub enum RequestError {
5    /// HTTP read error with HTTP status
6    HttpRead(HttpStatus),
7    /// TCP stream connection error with HTTP status
8    GetTcpStream(HttpStatus),
9    /// TLS stream connection error with HTTP status
10    GetTlsStream(HttpStatus),
11    /// Connection read error with HTTP status
12    ReadConnection(HttpStatus),
13    /// Request was aborted with HTTP status
14    RequestAborted(HttpStatus),
15    /// TLS stream connection failed with HTTP status
16    TlsStreamConnect(HttpStatus),
17    /// Redirect functionality needs to be enabled with HTTP status
18    NeedOpenRedirect(HttpStatus),
19    /// Maximum redirect times exceeded with HTTP status
20    MaxRedirectTimes(HttpStatus),
21    /// HTTP method not supported with HTTP status
22    MethodsNotSupport(HttpStatus),
23    /// Redirect URL is invalid with HTTP status
24    RedirectInvalidUrl(HttpStatus),
25    /// Client disconnected with HTTP status
26    ClientDisconnected(HttpStatus),
27    /// Redirect URL dead loop detected with HTTP status
28    RedirectUrlDeadLoop(HttpStatus),
29    /// Client closed connection with HTTP status
30    ClientClosedConnection(HttpStatus),
31    /// Server closed connection with HTTP status
32    ServerClosedConnection(HttpStatus),
33    /// Incomplete WebSocket frame with HTTP status
34    IncompleteWebSocketFrame(HttpStatus),
35    /// Request too long with HTTP status
36    RequestTooLong(HttpStatus),
37    /// Path too long with HTTP status
38    PathTooLong(HttpStatus),
39    /// Query too long with HTTP status
40    QueryTooLong(HttpStatus),
41    /// Header line too long with HTTP status
42    HeaderLineTooLong(HttpStatus),
43    /// Too many headers with HTTP status
44    TooManyHeaders(HttpStatus),
45    /// Header key too long with HTTP status
46    HeaderKeyTooLong(HttpStatus),
47    /// Header value too long with HTTP status
48    HeaderValueTooLong(HttpStatus),
49    /// Content length too large with HTTP status
50    ContentLengthTooLarge(HttpStatus),
51    /// Invalid content length with HTTP status
52    InvalidContentLength(HttpStatus),
53    /// Invalid URL scheme with HTTP status
54    InvalidUrlScheme(HttpStatus),
55    /// Invalid URL host with HTTP status
56    InvalidUrlHost(HttpStatus),
57    /// Invalid URL port with HTTP status
58    InvalidUrlPort(HttpStatus),
59    /// Invalid URL path with HTTP status
60    InvalidUrlPath(HttpStatus),
61    /// Invalid URL query with HTTP status
62    InvalidUrlQuery(HttpStatus),
63    /// Invalid URL fragment with HTTP status
64    InvalidUrlFragment(HttpStatus),
65    /// Read timeout with HTTP status
66    ReadTimeout(HttpStatus),
67    /// Write timeout with HTTP status
68    WriteTimeout(HttpStatus),
69    /// TCP connection failed with HTTP status
70    TcpConnectionFailed(HttpStatus),
71    /// TLS handshake failed with HTTP status
72    TlsHandshakeFailed(HttpStatus),
73    /// TLS certificate invalid with HTTP status
74    TlsCertificateInvalid(HttpStatus),
75    /// WebSocket frame too large with HTTP status
76    WebSocketFrameTooLarge(HttpStatus),
77    /// WebSocket opcode unsupported with HTTP status
78    WebSocketOpcodeUnsupported(HttpStatus),
79    /// WebSocket mask missing with HTTP status
80    WebSocketMaskMissing(HttpStatus),
81    /// WebSocket payload corrupted with HTTP status
82    WebSocketPayloadCorrupted(HttpStatus),
83    /// WebSocket invalid UTF-8 with HTTP status
84    WebSocketInvalidUtf8(HttpStatus),
85    /// WebSocket invalid close code with HTTP status
86    WebSocketInvalidCloseCode(HttpStatus),
87    /// WebSocket invalid extension with HTTP status
88    WebSocketInvalidExtension(HttpStatus),
89    /// HTTP request parts insufficient with HTTP status
90    HttpRequestPartsInsufficient(HttpStatus),
91    /// TCP stream connection error with HTTP status  
92    TcpStreamConnect(HttpStatus),
93    /// TLS connector build error with HTTP status
94    TlsConnectorBuild(HttpStatus),
95    /// Invalid URL error with HTTP status
96    InvalidUrl(HttpStatus),
97    /// Configuration read error with HTTP status
98    ConfigReadError(HttpStatus),
99    /// TCP stream connection error with HTTP status
100    TcpStreamConnectString(HttpStatus),
101    /// TLS connector build error with HTTP status
102    TlsConnectorBuildString(HttpStatus),
103    /// Request error with custom message
104    Request(String),
105    /// Unknown error with HTTP status
106    Unknown(HttpStatus),
107}