Skip to content
Snippets Groups Projects
Commit a47fdb43 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

storage_stats: Actually check the HTTP status code


By default reqwest does not return an actual error for non-success HTTP
status codes like HTTP 404.

This lead to parser failures when trying to read the HTML error message
from a 404 reply as a deb822 document.

Use `Response::error_for_status()` to actually check for successful
status codes.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 5569c481
No related branches found
No related tags found
No related merge requests found
Pipeline #378504 failed
This commit is part of merge request !111. Comments created here will be created in the context of that merge request.
......@@ -54,7 +54,7 @@ impl Client {
// NOTE: the URL should be printed since get() is instrumented.
debug!("GET");
Ok(self.client.get(url.clone()).send().await?.bytes().await?)
Ok(self.client.get(url.clone()).send().await?.error_for_status()?.bytes().await?)
}
#[instrument(skip(self))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment