Use reason_phrase instead of get_phrase

This commit is contained in:
Max Harmathy 2021-09-28 19:49:47 +02:00 committed by Evangelos Paterakis
parent c024b5c900
commit 3d6c835c09
2 changed files with 2 additions and 7 deletions

View File

@ -7,7 +7,7 @@ public class Tooth.ImageCache : AbstractCache {
protected Paintable decode (owned Soup.Message msg) throws Error {
var code = msg.status_code;
if (code != Soup.Status.OK) {
var error = network.describe_error (code);
var error = msg.reason_phrase;
throw new Oopsie.INSTANCE (@"Server returned $error");
}

View File

@ -56,7 +56,7 @@ public class Tooth.Network : GLib.Object {
else if (status == Soup.Status.CANCELLED)
debug ("Message is cancelled. Ignoring callback invocation.");
else
ecb ((int32) status, describe_error ((int32) status));
ecb ((int32) status, msg.reason_phrase);
});
}
catch (Error e) {
@ -65,11 +65,6 @@ public class Tooth.Network : GLib.Object {
}
}
public string describe_error (uint code) {
var reason = Soup.Status.get_phrase (code);
return @"$code: $reason";
}
public void on_error (int32 code, string message) {
warning (message);
app.toast (message);