-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Labels
enhancementNew feature or requestNew feature or requestfeedback requestedUser feedback desired on a design decisionUser feedback desired on a design decision
Description
When errors include Locations as in this example, it would be nice to specify the Location property name in the snafu::report proc. macro e.g. #[snafu::report(location(location))], so that the location gets printed with the errors.
#[derive(Debug, Snafu)]
pub enum EngineError {
#[snafu(display("{message}"))]
UrlParse {
message: String,
source: url::ParseError,
#[snafu(implicit)]
location: snafu::Location,
},
}would print
Error: Unable to frobnicate the mumbletypeg
Caused by these errors (recent errors listed first):
1: Could not contact the mumbletypeg API
2: The URL could not be parsed (/path/to/file.rs:123:45)
Note 1: all Location properties need to be named the same, but that is a reasonable constraint
Not 2: I know backtrace is available, but it is expensive to collect
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeedback requestedUser feedback desired on a design decisionUser feedback desired on a design decision