From 8a7897f28c63812afaabe26ae759dfdcec01f9e2 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 17 Jul 2020 16:22:54 +0200 Subject: turn HTTP status code to error If we don't do this, we end up trying to decode the error page as the expected JSON response, which usually ends up with a "missing permalink" field, which doesn't tell us a lot. This way, we get a proper 404/500 error. --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index ddf54d8..395a0b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -222,6 +222,7 @@ fn upload_log(file: &Path) -> Result { .query(&[("json", 1)]) .multipart(form) .send()? + .error_for_status()? .json()?; Ok(resp.permalink) } -- cgit v1.2.3