diff --git a/hammond-downloader/src/downloader.rs b/hammond-downloader/src/downloader.rs index 2f1209a..e85e440 100644 --- a/hammond-downloader/src/downloader.rs +++ b/hammond-downloader/src/downloader.rs @@ -30,8 +30,7 @@ fn download_into(dir: &str, file_title: &str, url: &str) -> Result { 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();