pub enum RunError {
Deadline,
Trap(Error),
Instantiate(Error),
Unavailable,
InvalidOutput,
}Expand description
Why a per-request filter call did not produce a decision. Kept deliberately distinct
from RequestDecision/ResponseDecision — those are the filter’s intentional typed
output; a RunError is the filter failing. The fast path MUST fail-closed on it:
synthesise an error response and never forward to upstream (CLAUDE.md — no fail-open).
Keeping the two apart also makes “deadline” vs “trap” an observable health signal.
Variants§
Deadline
The filter ran past its epoch deadline (ADR 000006 metering) and was interrupted. Fail-closed mapping: 504.
Trap(Error)
The filter trapped (unreachable, a guest panic, or an allocation past the Store
memory limit that aborted the guest). Fail-closed mapping: 502.
Instantiate(Error)
A fresh instance could not be created — untrusted per-request instantiation, or the rebuild of a trusted instance after a prior trap. Fail-closed mapping: 502.
A trusted filter trapped on several consecutive requests, so the host is in a short trap-cooldown: it returns this cheap fail-closed response instead of re-instantiating + re-init’ing every request (circuit-breaker, review f000003 #5). Fail-closed mapping: 503.
InvalidOutput
The guest returned cleanly but its output violates contract rules (CRLF / CTL / non-tchar
header, oversize header, or oversize synthesised body — ADR 000071 / 000073). Distinct
from Trap so operators can tell a misbehaving-but-alive filter from a crashing one;
fail-closed mapping is 502.
Implementations§
Source§impl RunError
impl RunError
Sourcepub fn fail_closed_response(&self) -> HttpResponse
pub fn fail_closed_response(&self) -> HttpResponse
A synthetic, fail-closed response for this fault (host helper; the fast path may send it directly). Deadline → 504, every other fault → 502. Never a pass-through.
Trait Implementations§
Source§impl Error for RunError
impl Error for RunError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for RunError
impl RefUnwindSafe for RunError
impl Send for RunError
impl Sync for RunError
impl Unpin for RunError
impl UnsafeUnpin for RunError
impl UnwindSafe for RunError
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 more