pub enum RunError {
Parse(String),
Types(Vec<String>),
Lower(String),
Eval(String),
Import(String),
}Expand description
Why a run stopped short.
Variants§
Parse(String)
Types(Vec<String>)
The type checker rejected the program. Carries every diagnostic, not just the first: a caller fixing one error wants to see the rest.
Each one is already rendered file:line:col: message against the file
the offending form came from — which, in a program with imports, is
frequently not the file the user named. The rendering happens here
rather than at the consumer because here is where the file table exists;
see uses::ResolvedProgram::locate.
Lower(String)
No longer reachable, and that is the point. This reported “blue
emitted a tree the reader could not read back” — a failure only a
print-then-reparse hop could have. crate::lower_to_spanned deleted
the hop, so there is nothing left to fail: the tree the evaluator gets
IS the tree erasure produced, not a re-reading of its text.
Kept rather than removed because it is public API on a released crate and a consumer may still match on it, per ★★ MODULARIZE, DON’T DELETE. It is retired, not orphaned — if a future stage ever serialises again it has a typed home. Nothing constructs it today; do not read its presence as evidence the pipeline can still fail this way.
Eval(String)
Import(String)
A use("name") could not be resolved.
Its own variant rather than folded into Parse, because the reader’s
next action is different: a parse error is in the source in front of
them, an import error is in their packaging — a missing bidama, a
BLUE_PATH that does not contain it, or no loader at all.
Trait Implementations§
Source§impl Error for RunError
impl Error for RunError
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()