pub enum GeopError {
Root {
message: String,
backtrace: Arc<Backtrace>,
},
Context {
inner: Box<GeopError>,
message: String,
},
Argument {
inner: Box<GeopError>,
key: String,
},
}Expand description
An error: what went wrong at the root, and the context it was reported through. A copy of one is the same error — a step’s failure kept with what it built, and reported again with more context — so the backtrace is shared, not captured again.
Variants§
Root
Context
inner, reported through a frame that says what was being done:
one line of the chain that GeopError::with_context builds.
Argument
inner, caused by the argument key of the step it was raised in:
what an editor shows the error beside — the field of that key (see
GeopError::concerning).
Implementations§
Source§impl GeopError
impl GeopError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Create a root error. Captures a backtrace at the call site.
Sourcepub fn with_context(self, message: impl Into<String>) -> Self
pub fn with_context(self, message: impl Into<String>) -> Self
Wrap this error in a Context frame with a string message.
Sourcepub fn concerning(self, key: impl Into<String>) -> Self
pub fn concerning(self, key: impl Into<String>) -> Self
Caused by the argument key of the step it is raised in — its
sketch, its distance — by a value that argument holds or an element
it refers to: an editor shows it beside that argument’s field.
Sourcepub fn argument(&self) -> Option<&str>
pub fn argument(&self) -> Option<&str>
The argument it was caused by (see GeopError::concerning): the
outermost one said, which the step that failed said — an argument of
a step it read from is that step’s.
Sourcepub fn root_message(&self) -> &str
pub fn root_message(&self) -> &str
What went wrong at the root, without the context it was reported through: what a user is shown.
Trait Implementations§
Source§impl Error for GeopError
impl Error for GeopError
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()