#[non_exhaustive]pub enum Error {
Api(Box<ApiError>),
Transport(Error),
NoCredentials,
Credentials(String),
Config(String),
InvalidRequest(String),
Decode(String),
NotDone(String),
}Expand description
What a call, or waiting on an operation, failed with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Api(Box<ApiError>)
The API refused the call, or the operation failed: branch on
ApiError::reason.
Transport(Error)
The call got no answer: the connection failed or broke off.
NoCredentials
Neither the environment nor a CLI session holds credentials.
Credentials(String)
The credentials couldn’t supply an access token.
Config(String)
The client’s configuration is invalid.
InvalidRequest(String)
The request can’t be sent as it is, such as a name of the wrong form; it was not sent.
Decode(String)
The answer couldn’t be read.
NotDone(String)
Operation::result of an operation that
isn’t done.
Implementations§
Source§impl Error
impl Error
Sourcepub fn api(&self) -> Option<&ApiError>
pub fn api(&self) -> Option<&ApiError>
The refusal, when the API refused the call or the operation failed.
Sourcepub fn reason(&self) -> Option<&str>
pub fn reason(&self) -> Option<&str>
The platform’s error code, such as NOT_FOUND, when the API refused
the call with one.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the API answered that the same call may succeed if it is sent again.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()