pub enum Error {
Show 31 variants
UnknownSymbol {
symbol: Symbol,
},
UnknownClass {
class: Symbol,
},
UnknownFunction {
function: Symbol,
},
MissingClass(ClassId),
WrongClass {
expected: ClassId,
found: ClassId,
},
WrongShape {
expected: ShapeId,
diagnostics: Vec<Diagnostic>,
},
AmbiguousOverload {
function: FunctionId,
candidates: Vec<CaseId>,
},
NoMatchingOverload {
function: FunctionId,
diagnostics: Vec<Diagnostic>,
},
AmbiguousNumberDispatch {
operator: Symbol,
candidates: Vec<(Symbol, Symbol)>,
},
NoPromotionPath {
operator: Symbol,
left_domain: Symbol,
right_domain: Symbol,
},
PromotionSearchLimitExceeded {
from_domain: Symbol,
target_domain: Symbol,
max_depth: usize,
max_states: usize,
},
CapabilityDenied {
capability: CapabilityName,
},
TrustDenied {
capability: CapabilityName,
trust: TrustLevel,
},
CodecError {
codec: CodecId,
message: String,
},
DomainError {
domain: Symbol,
category: Symbol,
message: String,
},
DuplicateExport {
kind: &'static str,
symbol: Symbol,
},
DuplicateLib {
symbol: Symbol,
},
CatalogConflict {
table: Symbol,
key: Symbol,
},
CatalogReadOnly {
table: Symbol,
},
CatalogSchema {
table: Symbol,
message: String,
},
MissingDependency {
lib: Symbol,
dependency: Symbol,
},
DependencyVersionMismatch {
lib: Symbol,
dependency: Symbol,
required: Version,
loaded: Version,
},
CyclicDependency {
symbol: Symbol,
},
LibHasDependents {
lib: Symbol,
dependents: Vec<Symbol>,
},
UndeclaredExportRecord {
kind: ExportKind,
symbol: Symbol,
},
TypeMismatch {
expected: &'static str,
found: &'static str,
},
Eval(String),
Lib(String),
PoisonedLock(&'static str),
RecursiveThunkForce,
HostError(String),
}Expand description
The kernel error type reported by every contract and library.
The kernel defines the shared error vocabulary; libraries raise these variants (and wrap their own messages in the string-carrying variants) rather than inventing parallel error types.
Variants§
UnknownSymbol
A symbol could not be resolved.
UnknownClass
A class name could not be resolved.
UnknownFunction
A function name could not be resolved.
MissingClass(ClassId)
No class is registered under the given id.
WrongClass
A value’s class did not match the expected class.
WrongShape
A value did not match the expected shape.
Fields
diagnostics: Vec<Diagnostic>Diagnostics explaining the mismatch.
AmbiguousOverload
More than one overload matched a call.
Fields
function: FunctionIdThe function being dispatched.
NoMatchingOverload
No overload matched a call.
Fields
function: FunctionIdThe function being dispatched.
diagnostics: Vec<Diagnostic>Diagnostics explaining why each case was rejected.
AmbiguousNumberDispatch
More than one numeric domain pairing matched an operator.
Fields
NoPromotionPath
No promotion path joined two number domains for an operator.
Fields
PromotionSearchLimitExceeded
Promotion search exceeded its configured limits.
Fields
CapabilityDenied
A required capability was not granted.
Fields
capability: CapabilityNameThe denied capability.
TrustDenied
A capability is not allowed at the caller’s trust level.
Fields
capability: CapabilityNameThe requested capability.
trust: TrustLevelThe caller’s trust level.
CodecError
A codec failed to read or write a form.
DomainError
A number (or other) domain reported a categorized failure.
Fields
DuplicateExport
Two exports of the same kind claimed the same symbol.
DuplicateLib
Two libraries claimed the same name.
CatalogConflict
A catalog write conflicted with an existing key.
CatalogReadOnly
A write targeted a read-only catalog table.
CatalogSchema
A catalog row violated its table schema.
Fields
MissingDependency
A library declared a dependency that is not loaded.
DependencyVersionMismatch
A dependency is present but older than required.
Fields
CyclicDependency
A cycle was found among library dependencies.
LibHasDependents
A library cannot be unloaded because loaded libraries depend on it.
Fields
UndeclaredExportRecord
An export record was produced without a matching manifest declaration.
TypeMismatch
A value’s static type did not match what was expected.
Fields
Eval(String)
Evaluation failed; carries a free-form message.
Lib(String)
A library reported a free-form failure.
PoisonedLock(&'static str)
A lock was poisoned by a panic; carries the lock name.
RecursiveThunkForce
A thunk was forced while already being forced.
HostError(String)
The host environment reported a free-form failure.
Implementations§
Source§impl Error
impl Error
Sourcepub fn domain_error(
domain: Symbol,
category: Symbol,
message: impl Into<String>,
) -> Self
pub fn domain_error( domain: Symbol, category: Symbol, message: impl Into<String>, ) -> Self
Builds a Error::DomainError from its parts.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()