-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust/treefile: Include filename in more error msgs
This uses the `Context` feature of the failure crate to make error messages more useful when we fail to open a file. The difference with `map_err` is that one can still obtain the underlying error from the context if need be. Though surprisingly, the normal `Display` for a `Context` doesn't include the original error, so we essentially have to do a prefix here (see [1]). Before: ``` error: Failed to load YAML treefile: No such file or directory (os error 2) ``` After: ``` error: Failed to load YAML treefile: Can't open file "treecompose-post.sh": No such file or directory (os error 2) ``` [1] rust-lang-deprecated/failure#182 Closes: #1735 Approved by: cgwalters
- Loading branch information
1 parent
1594140
commit 25d0213
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters