pub enum Error {
Configuration(String),
InvalidRequest(String),
Api(Box<ApiError>),
ResponseValidation {
field_path: String,
response: Box<RawResponse>,
},
Connection(Error),
Timeout {
timeout: Duration,
source: Error,
},
Cancelled,
}Expand description
An error returned by the TypeSafe SDK.
Variants§
Configuration(String)
Invalid client configuration.
InvalidRequest(String)
A request could not be constructed from the supplied arguments.
Api(Box<ApiError>)
The server returned an unsuccessful HTTP status.
ResponseValidation
A successful response did not contain the required data.
Fields
§
response: Box<RawResponse>The original response, available for inspection.
Connection(Error)
The request or response body could not be delivered.
Timeout
The full response did not arrive within the request timeout.
Fields
Cancelled
The caller cancelled the request.
Implementations§
Source§impl Error
impl Error
Sourcepub fn status(&self) -> Option<StatusCode>
pub fn status(&self) -> Option<StatusCode>
HTTP status for an API or response-validation error.
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Response request ID, if the server provided one.
Sourcepub fn as_api_error(&self) -> Option<&ApiError>
pub fn as_api_error(&self) -> Option<&ApiError>
The structured server error, when this is an HTTP failure.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more