Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Use reason_phrase instead of get_phrase #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Services/Cache/ImageCache.vala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Tootle.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");
}

Expand Down
7 changes: 1 addition & 6 deletions src/Services/Network/Network.vala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class Tootle.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) {
Expand All @@ -65,11 +65,6 @@ public class Tootle.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);
Expand Down