cloud_sdk_reqwest/shared/
error.rs1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
3pub enum BuildError {
4 ProtocolConfigurationFailed,
6 PlatformVerifierConfigurationFailed,
8 WebPkiRootsProtocolConfigurationFailed,
10 ClientBuildFailed,
12 CredentialEndpointMismatch,
14}
15
16impl_static_error!(BuildError,
17 Self::ProtocolConfigurationFailed => "TLS protocol configuration failed",
18 Self::PlatformVerifierConfigurationFailed => "platform verifier configuration failed",
19 Self::WebPkiRootsProtocolConfigurationFailed => "web PKI protocol configuration failed",
20 Self::ClientBuildFailed => "HTTP client construction failed",
21 Self::CredentialEndpointMismatch => "credential endpoint differs from transport endpoint",
22);
23
24#[derive(Clone, Copy, Debug, Eq, PartialEq)]
26pub enum TransportError {
27 CredentialStateUnavailable,
29 InsecureAuthenticationEndpoint,
31 AuthenticationEndpointMismatch,
33 AuthenticationScopeRejected,
35 TargetRejected,
37 MethodRejected,
39 MissingContentType,
41 HeaderRejected,
43 RequestBodyAllocationFailed,
45 RequestBodyTooLarge,
47 ResponseBodyAllocationFailed,
49 ConnectFailed,
51 TimedOut,
53 RequestFailed,
55 InvalidStatus,
57 InvalidResponseContentType,
59 InvalidResponseHeaders,
61 ResponseTooLarge,
63 ResponseReadFailed,
65 ResponseCommitFailed,
67 ResponseOriginChanged,
69 RawHttp(RawHttpError),
71}
72
73impl_static_error!(TransportError,
74 Self::CredentialStateUnavailable => "credential state is unavailable",
75 Self::InsecureAuthenticationEndpoint => "authenticated transport endpoint is not HTTPS",
76 Self::AuthenticationEndpointMismatch => "authentication endpoint differs from transport endpoint",
77 Self::AuthenticationScopeRejected => "bearer credential scope was rejected",
78 Self::TargetRejected => "request target was rejected",
79 Self::MethodRejected => "request method was rejected",
80 Self::MissingContentType => "request body content type is missing",
81 Self::HeaderRejected => "request header was rejected",
82 Self::RequestBodyAllocationFailed => "request-body allocation failed",
83 Self::RequestBodyTooLarge => "request body is too large",
84 Self::ResponseBodyAllocationFailed => "response-body allocation failed",
85 Self::ConnectFailed => "connection failed",
86 Self::TimedOut => "request timed out",
87 Self::RequestFailed => "request failed",
88 Self::InvalidStatus => "response status is invalid",
89 Self::InvalidResponseContentType => "response content type is invalid",
90 Self::InvalidResponseHeaders => "response headers are invalid",
91 Self::ResponseTooLarge => "response body exceeds the caller limit",
92 Self::ResponseReadFailed => "response body read failed",
93 Self::ResponseCommitFailed => "response commitment failed",
94 Self::ResponseOriginChanged => "response origin changed",
95 Self::RawHttp(_) => "bounded raw HTTP execution failed",
96);
97use super::RawHttpError;