Skip to content

Commit

Permalink
Make it print "val" on failure to retrieve URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Radiicall committed Aug 24, 2023
1 parent 0b5efc4 commit 2454bf6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/imgur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ impl Imgur {

Ok(val["data"]["link"]
.as_str()
.expect("imgur returned no image url!")
.unwrap_or_else(|| {
eprintln!("imgur returned no image url!\n{}", val);
std::process::exit(1)
})
.to_string())
}
}

0 comments on commit 2454bf6

Please sign in to comment.