Use bail! instead of panic!.
This commit is contained in:
parent
7be0b5bbf8
commit
ee7c5ca26e
@ -30,8 +30,7 @@ fn download_into(dir: &str, file_title: &str, url: &str) -> Result<String> {
|
||||
info!("Status Resp: {}", resp.status());
|
||||
|
||||
if !resp.status().is_success() {
|
||||
// TODO: Return an error instead of panicking.
|
||||
panic!("Bad request response.");
|
||||
bail!("Unexpected server response: {}", resp.status())
|
||||
}
|
||||
|
||||
let headers = resp.headers().clone();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user