pub struct ErrorCode(/* private fields */);Expand description
Wire-level error code. Every code is a Lisp-style symbol string,
rendered as the bare token after :code in the response envelope.
The wire surface is open: well-known engine-emitted codes are
associated &str constants on the type, while script-raised codes
(via (error 'symbol "msg")) flow through the same channel without
a sentinel. Clients pattern-match identically on engine and script
codes — adding a new well-known code is a non-breaking change.
Implementations§
Source§impl ErrorCode
impl ErrorCode
pub const ARGS: &str = "args"
pub const CONFIG: &str = "config"
pub const DB: &str = "db"
pub const SERVER: &str = "server"
pub const FINANCE: &str = "finance"
pub const SCRIPT: &str = "script"
pub const PARSE: &str = "parse"
pub const COMPILE: &str = "compile"
pub const RUNTIME: &str = "runtime"
pub const AUTH: &str = "auth"
pub const INTERRUPTED: &str = "interrupted"
pub const FORM_INVALID: &str = "form-invalid"
Sourcepub const BUSY: &str = "busy"
pub const BUSY: &str = "busy"
A write met a concurrent one on every attempt, or a stream’s queue was full; running it again may succeed.
Sourcepub const TOO_MANY_STREAMS: &str = "too-many-streams"
pub const TOO_MANY_STREAMS: &str = "too-many-streams"
A request would open a stream past the connection’s cap.
Sourcepub const NO_CONVERSION: &str = "no-conversion"
pub const NO_CONVERSION: &str = "no-conversion"
convert-commodity found no Price row linking source and
target in either direction. A host-classification label (not a
raised condition): cmd_failure turns the missing price of
convert-commodity into this host condition, and the remedy differs from a commodity
mismatch (add a price row vs. avoid the cross-commodity arithmetic).
Note: commodity-mismatch is NOT a const here — unlike no-conversion
it is a raised condition (the guest throws $nomi_error with the
reader-folded symbol code COMMODITY-MISMATCH; ADR-0026), so it rides
the ScriptRaised path with its code verbatim, like any script
(error 'sym …). It needs no well-known const.
Sourcepub const NOT_FOUND: &str = "not-found"
pub const NOT_FOUND: &str = "not-found"
The entity a command names does not exist (or is not visible to the user).
Sourcepub const UNAVAILABLE: &str = "unavailable"
pub const UNAVAILABLE: &str = "unavailable"
The database cannot be reached right now (pool exhausted or timed out, tenant quarantined, disabled or unknown); running it again later may succeed.
Sourcepub const HOST_CONDITIONS: [&str; 6]
pub const HOST_CONDITIONS: [&str; 6]
The codes a native can throw as a host condition.
pub fn new(symbol: impl Into<String>) -> Self
pub fn as_symbol(&self) -> &str
Trait Implementations§
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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