pub enum Error {
Show 28 variants
Validation {
message: String,
},
Routing {
message: String,
},
Proxy {
message: String,
},
Latency {
message: String,
},
Config {
message: String,
},
ProtocolNotFound {
message: String,
},
ProtocolDisabled {
message: String,
},
ProtocolHandlerInUse {
message: String,
},
ProtocolValidationError {
protocol: String,
message: String,
},
Io(Error),
Json(Error),
Yaml(Error),
Http(Error),
UrlParse(ParseError),
Regex(Error),
RouteNotFound {
method: String,
path: String,
},
SchemaValidationFailed {
path: String,
expected: String,
actual: String,
},
ConfigWithSource {
message: String,
source: Box<dyn Error + Send + Sync>,
},
NotFound {
entity: String,
id: String,
},
FeatureDisabled {
feature: String,
},
AlreadyInitialized {
component: String,
},
InvalidState {
message: String,
},
SiemTransport {
message: String,
},
IoWithContext {
context: String,
message: String,
},
Internal {
message: String,
},
Generic(String),
Encryption(EncryptionError),
JavaScript(Error),
}Expand description
Core error types for MockForge operations
Variants§
Validation
Validation error (schema/format validation failed)
Routing
Routing error (route not found or invalid)
Proxy
Proxy error (proxy request failed)
Latency
Latency simulation error (latency injection failed)
Config
Configuration error (invalid config or missing required fields)
ProtocolNotFound
Protocol not found (requested protocol is not registered)
ProtocolDisabled
Protocol disabled (protocol exists but is disabled)
ProtocolHandlerInUse
Protocol handler in use (handler already registered)
ProtocolValidationError
Protocol validation error (protocol-specific validation failed)
Fields
Io(Error)
I/O error (file read/write operations)
Json(Error)
JSON serialization/deserialization error
Yaml(Error)
YAML serialization/deserialization error
Http(Error)
HTTP client request error
UrlParse(ParseError)
URL parsing error
Regex(Error)
Regular expression compilation error
RouteNotFound
Route not found error with method and path context
SchemaValidationFailed
Schema validation failed with structured context
Fields
ConfigWithSource
Configuration error with source
Fields
NotFound
Entity not found
FeatureDisabled
Feature is disabled
AlreadyInitialized
Global component already initialized
InvalidState
Invalid state for the requested operation
SiemTransport
SIEM transport error
IoWithContext
I/O error with additional context
Fields
Internal
Internal error wrapping an underlying cause
Generic(String)
Generic error with message string
Encryption(EncryptionError)
Encryption/decryption operation error
JavaScript(Error)
JavaScript evaluation error (template engine, etc.)
Implementations§
Source§impl Error
impl Error
Sourcepub fn validation<S>(message: S) -> Error
pub fn validation<S>(message: S) -> Error
Create a validation error
Sourcepub fn protocol_not_found<S>(message: S) -> Error
pub fn protocol_not_found<S>(message: S) -> Error
Create a protocol not found error
Sourcepub fn protocol_disabled<S>(message: S) -> Error
pub fn protocol_disabled<S>(message: S) -> Error
Create a protocol disabled error
Sourcepub fn protocol_handler_in_use<S>(message: S) -> Error
pub fn protocol_handler_in_use<S>(message: S) -> Error
Create a protocol handler in use error
Sourcepub fn protocol_validation_error<S>(protocol: S, message: S) -> Error
pub fn protocol_validation_error<S>(protocol: S, message: S) -> Error
Create a protocol validation error
Sourcepub fn route_not_found<S>(method: S, path: S) -> Error
pub fn route_not_found<S>(method: S, path: S) -> Error
Create a route-not-found error with method and path context
Sourcepub fn schema_validation_failed<S>(path: S, expected: S, actual: S) -> Error
pub fn schema_validation_failed<S>(path: S, expected: S, actual: S) -> Error
Create a schema validation error with path, expected, and actual context
Sourcepub fn config_with_source<S>(
message: S,
source: impl Error + Send + Sync + 'static,
) -> Error
pub fn config_with_source<S>( message: S, source: impl Error + Send + Sync + 'static, ) -> Error
Create a configuration error with an underlying source error
Sourcepub fn feature_disabled<S>(feature: S) -> Error
pub fn feature_disabled<S>(feature: S) -> Error
Create a feature-disabled error
Sourcepub fn already_initialized<S>(component: S) -> Error
pub fn already_initialized<S>(component: S) -> Error
Create an already-initialized error
Sourcepub fn invalid_state<S>(message: S) -> Error
pub fn invalid_state<S>(message: S) -> Error
Create an invalid-state error
Sourcepub fn siem_transport<S>(message: S) -> Error
pub fn siem_transport<S>(message: S) -> Error
Create a SIEM transport error
Sourcepub fn io_with_context<S1, S2>(context: S1, message: S2) -> Error
pub fn io_with_context<S1, S2>(context: S1, message: S2) -> Error
Create an I/O error with context
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<EncryptionError> for Error
impl From<EncryptionError> for Error
Source§fn from(source: EncryptionError) -> Error
fn from(source: EncryptionError) -> Error
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Error
fn from(source: ParseError) -> Error
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§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.