pub enum ProgramError {
Syntax {
line: usize,
message: String,
},
Json(String),
UnsupportedVersion {
found: u64,
supported: u32,
},
Check(String),
Data(String),
}Expand description
Why a program could not be read, written or compiled.
Runtime problems are not errors: once a program compiles, building and running its model never fails — see the module docs’ error policy.
Variants§
Syntax
The text front end rejected the source.
Fields
Json(String)
The JSON front end could not decode the document.
UnsupportedVersion
The document’s fugue_program version is not one this build reads.
Fields
supported: u32The version this build reads (FORMAT_VERSION).
Check(String)
The program is well-formed but does not check: an unknown variable,
distribution or function, a wrong argument count, a break outside a
loop, a non-finite literal, a non-identifier name, or nesting beyond
MAX_NESTING (which the text front end, refusing as it reads,
reports as a Syntax error with its line).
Data(String)
The data payload is malformed.
Trait Implementations§
Source§impl Clone for ProgramError
impl Clone for ProgramError
Source§impl Debug for ProgramError
impl Debug for ProgramError
Source§impl Display for ProgramError
impl Display for ProgramError
Source§impl Error for ProgramError
impl Error for ProgramError
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()