shepmaster / snafu

Easily assign underlying errors into domain-specific errors while adding context
https://docs.rs/snafu/
Apache License 2.0
1.45k stars 61 forks source link

Error when source/backtrace(false) given on wrong field #156

Closed tjkirch closed 5 years ago

tjkirch commented 5 years ago

Fixes #140

This adds errors for specifying source(false) on fields not named "source", and backtrace(false) on fields not named "backtrace". These almost surely represent the user being confused about their purpose, and these error messages can help explain.


Testing done:

New compile-fail tests were added to show the errors in action.

Note: the attribute-misuse.rs compile-fail test was also updated because... it was using source(false) in this incorrect manner :)