pub enum AdminError {
Http(Error),
Status {
method: String,
url: String,
code: u16,
body: String,
},
Decode {
method: String,
url: String,
status: u16,
content_type: String,
snippet: String,
source: Error,
},
Json(Error),
Url(ParseError),
Builder(String),
Auth(String),
InvalidName(String),
Protocol(String),
}Expand description
Errors returned by the admin client.
Variants§
Http(Error)
Transport-layer error from reqwest.
Status
API returned a non-success HTTP status.
method and url identify the exact request that failed, so an
operator can tell at a glance whether they hit the wrong endpoint,
cluster, or proxy without re-deriving the URL from the call site.
Fields
Decode
A 2xx response body could not be decoded as the expected JSON.
Carries the request method + url, the HTTP status, the
response content_type, and a truncated body snippet so the
failure is self-diagnosing: a text/html body or an empty
<none> content-type on a 200 almost always means the request
was answered by the wrong endpoint, a reverse proxy, or an auth
redirect rather than the broker’s admin API. Replaces the bare
serde_json “expected value at line 1 column 1” message.
Fields
Json(Error)
JSON encode error — building a request body from a Rust value.
Response-decode failures surface as AdminError::Decode; this
variant covers the rare serialization-side failure (e.g.
build_url_config_multipart).
Url(ParseError)
URL parse / construction error.
Builder(String)
Builder configuration error (missing service URL, invalid argument…).
Auth(String)
Authentication failure — e.g. the OAuth2 client_credentials exchange
failed or returned an empty access token.
InvalidName(String)
Caller passed a namespace or topic name that the client could not parse.
Protocol(String)
Broker returned a response that violates the documented wire contract
(e.g. negative ledgerId from getMessageIdByIndex, which Java
MessageIdImpl cannot represent either).
Trait Implementations§
Source§impl Debug for AdminError
impl Debug for AdminError
Source§impl Display for AdminError
impl Display for AdminError
Source§impl Error for AdminError
impl Error for AdminError
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()