Skip to content

Commit 2c96710

Browse files
committed
Auto merge of #393 - Zeegomo:master, r=pietroalbini
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`
2 parents e35ed43 + de116ab commit 2c96710

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server/tokens.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ impl Default for Tokens {
8181

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

0 commit comments

Comments
 (0)