pub enum RuntimeError {
Bytecode(BytecodeError),
UnknownTarget(String),
WrongProbeKind {
name: String,
},
MatchFailed(String),
AssertFailed(String),
ExtractFailed {
name: String,
reason: String,
},
Flow(String),
InvalidDuration(String),
Http(Error),
Io(Error),
Regex(Error),
Other(String),
}Expand description
An error that aborts execution. Most variants carry a message; the
#[from] variants wrap lower-level errors (bytecode decode, HTTP, I/O,
regex). A failed match does not produce one of these — only assert,
fail, and genuine transport/decoding failures do.
Variants§
Bytecode(BytecodeError)
The .rbc input could not be decoded or failed validation.
UnknownTarget(String)
An instruction referenced a probe name the program does not define.
WrongProbeKind
An HTTP-only operation (extract, a header matcher) was aimed at a
DNS, TCP, or UDP probe.
MatchFailed(String)
A match could not be evaluated at all — not the same as a matcher
that evaluated to false, which simply clears matched.
AssertFailed(String)
An assert evaluated to false and aborted the script.
ExtractFailed
An extract found nothing to bind: the regex did not match, or the
named header was absent.
Fields
Flow(String)
Internal control-flow signal (break, continue, stop, exit)
travelling as an error. The executor consumes these; they never reach
a caller.
InvalidDuration(String)
A duration literal (500ms, 2s) could not be parsed.
Http(Error)
The HTTP client failed: DNS, connect, TLS, timeout, or body decode.
Call RuntimeError::full_message for the underlying cause.
Io(Error)
A socket operation failed (TCP/UDP connect, read, or write).
Regex(Error)
A regex in a matcher, extract, or evidence rule failed to compile.
Other(String)
Anything that does not fit the variants above; carries its own message.
Implementations§
Source§impl RuntimeError
impl RuntimeError
Sourcepub fn match_failed(matcher: &QualifiedMatch, detail: impl Into<String>) -> Self
pub fn match_failed(matcher: &QualifiedMatch, detail: impl Into<String>) -> Self
Build a RuntimeError::MatchFailed that names the matcher that could
not be evaluated alongside detail.
Sourcepub fn assert_failed(
matcher: &QualifiedMatch,
detail: impl Into<String>,
) -> Self
pub fn assert_failed( matcher: &QualifiedMatch, detail: impl Into<String>, ) -> Self
Build a RuntimeError::AssertFailed that names the assertion that
did not hold alongside detail.
Sourcepub fn full_message(&self) -> String
pub fn full_message(&self) -> String
The complete error message, including every underlying cause.
thiserror’s Display renders only this error’s own message. For the
wrapped HTTP and I/O variants the real reason — a rejected TLS
certificate, a connection reset, a response body that failed to decode —
lives in the source chain and would
otherwise be dropped, leaving an opaque "http error: …". This walks
that chain and joins it into one line so logs and scan reports carry the
actual cause.
Trait Implementations§
Source§impl Debug for RuntimeError
impl Debug for RuntimeError
Source§impl Display for RuntimeError
impl Display for RuntimeError
Source§impl Error for RuntimeError
impl Error for RuntimeError
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()