#[non_exhaustive]#[repr(i32)]pub enum LibraryExn {
Show 14 variants
Syscall(SyscallExn),
Handling(HandlingError),
Calling(CallingError),
Called(FaultString),
AuthToken(AuthTokenError),
BytestringWrongSize {
expected: u32,
found: u32,
},
NonNegativeIntUnderflow = 6,
NonNegativeIntOverflow = 7,
StorageSerialization = 8,
StorageIndexOutOfBounds {
len: u64,
access: u64,
},
StorageKeypathOverflow = 10,
RetrocausalQueueEntryWrongSize {
expected: u32,
found: u32,
},
CapacityConstraintAlreadyWritten = 12,
UnknownMethod = 13,
}Expand description
An exception generated by SDK internals.
The wire layout is fixed regardless of crate features – discriminants
and payloads alike. Both halves of that have been broken before:
discriminant 8 was once a feature-gated Storage(StorageError) nested
enum (now the flat StorageSerialization, with the other storage
conditions at 9 and 10), and the variants carrying a
FaultString once encoded its message under
debugging, so an abort payload differed between a host test and the
shipped artifact. FaultString now keeps its message host-side and
encodes to nothing. Keep new variants payload-stable the same way.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Syscall(SyscallExn)
Handling(HandlingError)
Calling(CallingError)
Called(FaultString)
AuthToken(AuthTokenError)
BytestringWrongSize
NonNegativeIntUnderflow = 6
NonNegativeIntOverflow = 7
StorageSerialization = 8
StorageIndexOutOfBounds
StorageKeypathOverflow = 10
RetrocausalQueueEntryWrongSize
CapacityConstraintAlreadyWritten = 12
UnknownMethod = 13
The invoked method id matched no entrypoint on this contract.
Thrown by guest dispatch (and by the native mock, for a contract
registered through register_mock_package) in place of the bare
trap it used to answer with, which a caller could not tell apart
from an OOB access or a bad instruction. Carries no method id —
the caller picked the id it invoked.
Implementations§
Source§impl LibraryExn
impl LibraryExn
pub fn as_syscall_exn(&self) -> Option<&SyscallExn>
Sourcepub fn is_storage_missing(&self) -> bool
pub fn is_storage_missing(&self) -> bool
True if this is a syscall error saying nothing is stored where a
storage read looked: a missing key
(kSyscallErrorCodeStorageKeyNotExist)
or an empty retro-causal queue
(kSyscallErrorCodeNoRetrocausalQueueEntry).
This is the “graceful” arm of the storage try_ getters: a try_get
/ try_consume Err for which this returns false means the read
failed for a reason other than absence (wrong storage type at the
key, a corrupt encoding, a host fault).
Trait Implementations§
Source§impl ConstMaxSize for LibraryExn
impl ConstMaxSize for LibraryExn
Source§impl ConstMaxSize for LibraryExn
impl ConstMaxSize for LibraryExn
Source§impl ContractTypeName for LibraryExn
impl ContractTypeName for LibraryExn
Source§const NAME: ContractSpecIdView<'static>
const NAME: ContractSpecIdView<'static>
Source§impl ContractTypeRefSpec for LibraryExn
impl ContractTypeRefSpec for LibraryExn
Source§const INFO: ContractTypeInfo<'static>
const INFO: ContractTypeInfo<'static>
__THRUPUT_SPEC_ANCHOR_ROOT) and resolved by spec-tool.Source§const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
ContractTypeView::SignedToken’s payload): the type itself by
default, or None for a type-erased payload (the SDK’s Opaque
overrides this).Source§impl ContractTypeSpec for LibraryExn
impl ContractTypeSpec for LibraryExn
Source§const TYPE_DEF: ContractTypeDefView<'static>
const TYPE_DEF: ContractTypeDefView<'static>
Source§impl Debug for LibraryExn
impl Debug for LibraryExn
Source§impl Display for LibraryExn
impl Display for LibraryExn
impl EncodesAs<LibraryExn> for LibraryExn
Source§impl Error for LibraryExn
impl Error for LibraryExn
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<AuthTokenError> for LibraryExn
impl From<AuthTokenError> for LibraryExn
Source§fn from(e: AuthTokenError) -> Self
fn from(e: AuthTokenError) -> Self
Source§impl From<CallingError> for LibraryExn
impl From<CallingError> for LibraryExn
Source§fn from(e: CallingError) -> Self
fn from(e: CallingError) -> Self
Source§impl From<HandlingError> for LibraryExn
impl From<HandlingError> for LibraryExn
Source§fn from(e: HandlingError) -> Self
fn from(e: HandlingError) -> Self
Source§impl PartialEq for LibraryExn
impl PartialEq for LibraryExn
Source§impl ReThrow for LibraryExn
Result<T, LibraryExn>::or_re_throw() aborts with the contained
library exception (typed, decodable by selector) rather than a fault.
impl ReThrow for LibraryExn
Result<T, LibraryExn>::or_re_throw() aborts with the contained
library exception (typed, decodable by selector) rather than a fault.