#[non_exhaustive]pub enum Error {
Http(Error),
Api(ApiError),
Decode(DeError),
UnexpectedStatus {
status: StatusCode,
body: String,
},
EmptyResponse,
Configuration(String),
}Expand description
Any error that can occur while talking to the Namecheap API.
Failures are split into distinct categories so callers can react to them
individually. In particular, errors reported by Namecheap inside the XML
response body are surfaced as Error::Api and kept separate from
transport-level HTTP failures (Error::Http).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Http(Error)
The HTTP request could not be sent or the response could not be read (DNS failure, connection reset, timeout, TLS error, and so on).
Api(ApiError)
Namecheap accepted the request but returned one or more errors in the
<Errors> block of the XML response.
Decode(DeError)
The response body could not be decoded as the expected Namecheap XML.
UnexpectedStatus
The server returned a non-success HTTP status and the body was not a recognizable Namecheap error document.
Fields
status: StatusCodeThe HTTP status code returned by the server.
EmptyResponse
Namecheap reported success but the response contained no command result.
Configuration(String)
The Client was misconfigured (for example, a required
credential was missing when calling
ClientBuilder::build).
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()