Skip to content

Commit

Permalink
Auto merge of #393 - Zeegomo:master, r=pietroalbini
Browse files Browse the repository at this point in the history
Add context info for tokens.toml load failure

My fresh clone of crater failed to run and i didn't know why, then 30 mins later I found out that I forgot to rename tokens.example.toml to tokens.toml. This should fix that with a friendly error `could not find tokens.toml`
  • Loading branch information
bors committed Jan 25, 2019
2 parents e35ed43 + de116ab commit 2c96710
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ impl Default for Tokens {

impl Tokens {
pub fn load() -> Fallible<Tokens> {
let content = ::std::fs::read_to_string(Path::new(TOKENS_PATH))?;
let content = ::std::fs::read_to_string(Path::new(TOKENS_PATH))
.with_context(|_| format!("could not find {}", TOKENS_PATH))?;
let res = ::toml::from_str(&content)?;
Ok(res)
}
Expand Down

0 comments on commit 2c96710

Please sign in to comment.