Use reason_phrase instead of get_phrase
This commit is contained in:
parent
c024b5c900
commit
3d6c835c09
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue