Module error

error

Standard error handling types and traits for Yo.

Types

AnyError type-alias
AnyError

Type-erased dynamic error type. Wraps any type implementing Error.

Traits / Modules

Error trait
Error

Standard error trait for typed error propagation. All error types should implement this trait along with ToString.

Methods

source : fn(self : *(Self)) -> Option(Dyn(trait((() : Type(1)) = Runtime(id: "Runtime")), ToString))

Parameters

NameTypeNotes
self*(Self)

Returns: Option(Dyn(trait((() : Type(1)) = Runtime(id: "Runtime")), ToString))

Implementors

Exception module
Exception

Non-resumable exception handling effect module. Use throw to raise an AnyError and abort the current computation.

Methods

throw : fn(forall(comptime(ResumeType) : Type), error : AnyError) -> ResumeType

Parameters

NameTypeNotes
errorAnyError

Returns: ResumeType

ResumableException trait-function
fn(comptime(ResumeType) : Type) -> (comptime(fn_return_yo8c454b41_id_73) : Type(1))

Creates a resumable exception module parameterized by the resume type. Unlike Exception, the handler can return a value to resume the computation.

Type Parameters

NameTypeNotes
ResumeTypeTypecomptime