#[non_exhaustive]pub enum SondaError {
Config(ConfigError),
Encoder(EncoderError),
Sink(Error),
Generator(GeneratorError),
Runtime(RuntimeError),
}Expand description
Top-level error type for sonda-core.
Each variant delegates to a typed sub-enum that preserves the original
error source where possible. This enables callers to programmatically
inspect error origins (e.g., distinguish io::ErrorKind::NotFound from
PermissionDenied in a generator file-read error) via the standard
std::error::Error::source chain.
The Sink variant wraps std::io::Error without a blanket #[from]
conversion — all I/O errors must be explicitly mapped to the correct
variant at the call site. This prevents generator or config I/O errors
from being misclassified as sink errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Config(ConfigError)
An error in scenario configuration (invalid values, missing fields).
Encoder(EncoderError)
An error during event encoding (serialization, timestamp, protobuf).
Sink(Error)
An I/O error originating from a sink (stdout, file, TCP, UDP, HTTP).
This variant does not use #[from] std::io::Error because not all
I/O errors originate from sinks. Generator file reads, for example,
produce SondaError::Generator instead.
Generator(GeneratorError)
An error from a generator (file I/O, invalid data).
Runtime(RuntimeError)
A runtime or system error (thread spawn failure, thread panic).
These are environmental failures that are outside the user’s control
and cannot be fixed by editing configuration. Separated from
ConfigError so that consumers matching on config errors to
surface YAML validation feedback are not confused by thread panics.
Trait Implementations§
Source§impl Debug for SondaError
impl Debug for SondaError
Source§impl Display for SondaError
impl Display for SondaError
Source§impl Error for SondaError
impl Error for SondaError
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()