pub enum CmdError {
MissingApiKey,
Usage(String),
Auth(String),
RateLimited {
retry_after: Duration,
},
Validation {
code: String,
message: String,
},
Server(String),
Network(String),
Decode(String),
Keystore(String),
Signing(String),
Unimplemented(&'static str),
Config(ConfigError),
}Expand description
CLI-layer error. Every variant maps to a stable code string (in the
envelope) and a stable ExitCode bucket — both are part of the
orchestrator contract.
Variants§
MissingApiKey
Usage(String)
Auth(String)
RateLimited
Validation
Server(String)
Network(String)
Decode(String)
Keystore(String)
Signing(String)
Unimplemented(&'static str)
Config(ConfigError)
Implementations§
Source§impl CmdError
impl CmdError
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
Short, stable code string for the JSON envelope’s error.code field.
Sourcepub fn exit_code(&self) -> ExitCode
pub fn exit_code(&self) -> ExitCode
Stable exit-code bucket — see ExitCode docstring for the taxonomy.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Server-directed sleep hint, if any. Populated only for
Self::RateLimited so orchestrators can read it directly from the
envelope instead of parsing the message.
Trait Implementations§
Source§impl Error for CmdError
impl Error for CmdError
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()
Source§impl From<ConfigError> for CmdError
impl From<ConfigError> for CmdError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CmdError
impl From<Error> for CmdError
Source§fn from(e: ClientError) -> Self
fn from(e: ClientError) -> Self
Converts to this type from the input type.
Source§impl From<KeystoreError> for CmdError
impl From<KeystoreError> for CmdError
Source§fn from(e: KeystoreError) -> Self
fn from(e: KeystoreError) -> Self
Converts to this type from the input type.
Source§impl From<SigningError> for CmdError
impl From<SigningError> for CmdError
Source§fn from(e: SigningError) -> Self
fn from(e: SigningError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CmdError
impl !UnwindSafe for CmdError
impl Forget for CmdError
impl Freeze for CmdError
impl Move for CmdError
impl Send for CmdError
impl Sync for CmdError
impl Unpin for CmdError
impl UnsafeUnpin for CmdError
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
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.