qubit_http/error/http_error_kind.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026.
4 * Haixing Hu, Qubit Co. Ltd.
5 *
6 * All rights reserved.
7 *
8 ******************************************************************************/
9//! HTTP error category enum.
10
11/// Category of HTTP errors.
12#[derive(Debug, Clone, Copy, PartialEq, Eq)]
13pub enum HttpErrorKind {
14 /// URL is invalid or cannot be resolved.
15 InvalidUrl,
16 /// HTTP client construction failed.
17 BuildClient,
18 /// Proxy configuration is invalid.
19 ProxyConfig,
20 /// Connect timeout.
21 ConnectTimeout,
22 /// Read timeout.
23 ReadTimeout,
24 /// Write timeout.
25 WriteTimeout,
26 /// Whole-request timeout (client/request-level deadline).
27 RequestTimeout,
28 /// Transport-level request error.
29 Transport,
30 /// Non-success HTTP status.
31 Status,
32 /// Response decoding error.
33 Decode,
34 /// SSE protocol error.
35 SseProtocol,
36 /// SSE payload decoding error.
37 SseDecode,
38 /// Request was cancelled or interrupted.
39 Cancelled,
40 /// Any other error.
41 Other,
42}