pub enum CliError {
Show 16 variants
ConfigNotFound {
path: PathBuf,
},
InvalidConfig {
message: String,
},
ScenarioNotFound {
path: PathBuf,
},
InvalidScenario {
message: String,
},
UnsupportedProtocol {
protocol: String,
},
DeviceNotFound {
device_id: String,
},
PortInUse {
port: u16,
},
ExecutionFailed {
message: String,
},
ValidationFailed {
errors: String,
},
Io(Error),
Yaml(Error),
Json(Error),
Simulator(Error),
Interrupted,
Timeout {
duration_secs: u64,
},
WithContext {
context: String,
source: Box<CliError>,
},
}Expand description
CLI-specific error types.
Variants§
ConfigNotFound
Configuration file not found.
InvalidConfig
Invalid configuration format.
ScenarioNotFound
Scenario file not found.
InvalidScenario
Invalid scenario format.
UnsupportedProtocol
Protocol not supported.
DeviceNotFound
Device not found.
PortInUse
Port already in use.
ExecutionFailed
Command execution failed.
ValidationFailed
Validation failed.
Io(Error)
IO error.
Yaml(Error)
YAML parsing error.
Json(Error)
JSON parsing error.
Simulator(Error)
Core simulator error.
Interrupted
User interrupted operation.
Timeout
Timeout reached.
WithContext
Generic error with context.
Implementations§
Source§impl CliError
impl CliError
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context to an error.
Sourcepub fn validation_failed(
errors: impl IntoIterator<Item = impl AsRef<str>>,
) -> Self
pub fn validation_failed( errors: impl IntoIterator<Item = impl AsRef<str>>, ) -> Self
Create a validation failed error from multiple messages.
Trait Implementations§
Source§impl Error for CliError
impl Error for CliError
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()
Auto Trait Implementations§
impl Freeze for CliError
impl !RefUnwindSafe for CliError
impl Send for CliError
impl Sync for CliError
impl Unpin for CliError
impl UnsafeUnpin for CliError
impl !UnwindSafe for CliError
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 more