pub struct ExecError {
pub message: String,
pub span: Span,
pub raised: Option<Box<(Arc<str>, Value)>>,
}Expand description
A failure while executing Core.
Carries a span because a language server has to survive evaluating half-written code, and because “folding at seq 41 failed” is not an answer without a location.
Fields§
§message: String§span: Span§raised: Option<Box<(Arc<str>, Value)>>The value a raise failed with and that value’s type name, when this failure is one the
program chose rather than a fault.
A raise is a row label (§3.2, crate::row::Effect::Raises) and try: matches on the
type name, so a raise that crossed this seam as a message alone would arrive at a handler
as something it could not catch — the failure would be real and the Result the program
was checked against unreachable. It is on the seam rather than inside a backend for the
reason every other thing here is: a stub that fails is a beck-rt facility and beck-rt
may not name a backend crate (docs/19 §19.9).
Implementations§
Source§impl ExecError
impl ExecError
pub fn new(message: impl Into<String>, span: Span) -> ExecError
Sourcepub fn raise(ty: Arc<str>, value: Value, span: Span) -> ExecError
pub fn raise(ty: Arc<str>, value: Value, span: Span) -> ExecError
A failure a program chose: raise Declined(…), carrying the value and its type.
Sourcepub fn raised_type(&self) -> Option<&str>
pub fn raised_type(&self) -> Option<&str>
The type name this failure raised, if it raised at all.