gleamunison/run_error
Why a ref did not run, and how to say it to a person.
The vocabulary is one type in one module because three concerns share it: resolving the closure, executing the definition, and inspecting it without executing. Splitting those into separate modules with separate error types would only add translation layers between them.
Types
pub type RunError {
Missing(ref: identity.DefinitionRef)
Unreadable(ref: identity.DefinitionRef, reason: String)
NotExecutable(ref: identity.DefinitionRef, kind: String)
LoadFailed(ref: identity.DefinitionRef, reason: String)
Cycle(ref: identity.DefinitionRef)
ArityUnavailable(
ref: identity.DefinitionRef,
expected: Int,
supplied: Int,
)
NoEvidence(ref: identity.DefinitionRef, reason: String)
EvaluationFailed(ref: identity.DefinitionRef, reason: String)
}
Constructors
-
Missing(ref: identity.DefinitionRef) -
Unreadable(ref: identity.DefinitionRef, reason: String) -
NotExecutable(ref: identity.DefinitionRef, kind: String) -
LoadFailed(ref: identity.DefinitionRef, reason: String) -
Cycle(ref: identity.DefinitionRef) -
ArityUnavailable( ref: identity.DefinitionRef, expected: Int, supplied: Int, ) -
NoEvidence(ref: identity.DefinitionRef, reason: String) -
EvaluationFailed(ref: identity.DefinitionRef, reason: String)
Values
pub fn describe_load(error: loader.LoaderError) -> String
pub fn read_error(
ref: identity.DefinitionRef,
error: codebase.ReadError,
) -> RunError