pub enum ControlPlaneClientError {
Unreachable {
url: String,
source: Error,
},
Unauthorized,
NotFound(AgentId),
Unsupported(String),
Api {
status: StatusCode,
message: String,
},
Malformed(Error),
}Expand description
Why a control-plane call failed.
The distinctions are the ones a caller acts on differently: a bad token is
fixed by the operator, a missing agent by naming another one, an unreachable
URL by starting the control plane — and everything else is the control
plane’s own diagnosis, which is worth passing through verbatim (it is where
“line 4: unknown key http_prot” and “references env vars that are not
allowed” come from).
Variants§
Unreachable
The control plane could not be reached at all.
The request was rejected for want of a valid bearer token.
NotFound(AgentId)
No agent with that id is deployed.
Unsupported(String)
This control plane cannot serve the request — e.g. logs from a runtime that does not capture them.
Api
The control plane refused or failed the request, and said why.
Fields
status: StatusCodeThe HTTP status it answered with.
Malformed(Error)
A response arrived but was not the shape this client expects.
Trait Implementations§
Source§impl Debug for ControlPlaneClientError
impl Debug for ControlPlaneClientError
Source§impl Display for ControlPlaneClientError
impl Display for ControlPlaneClientError
Source§impl Error for ControlPlaneClientError
impl Error for ControlPlaneClientError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for ControlPlaneClientError
impl !UnwindSafe for ControlPlaneClientError
impl Freeze for ControlPlaneClientError
impl Send for ControlPlaneClientError
impl Sync for ControlPlaneClientError
impl Unpin for ControlPlaneClientError
impl UnsafeUnpin for ControlPlaneClientError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more