Mholloway has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/374818 )
Change subject: Include the request URL in an HttpStatusException message
......................................................................
Include the request URL in an HttpStatusException message
A fair number of users are encountering 404s when attempting to save
pages, which shouldn't happen. This adds the request URL to the
HttpStatusException message for remote logging in order to help surface
any hidden problems.
Change-Id: I8a64f6ace03e1cf5f1325abb5828ee8e40bbb908
---
M app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/18/374818/1
diff --git
a/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
b/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
index 705eefe..fbc3672 100644
--- a/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
+++ b/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
@@ -8,9 +8,11 @@
public class HttpStatusException extends IOException {
private final int code;
+ private final String url;
public HttpStatusException(@NonNull Response rsp) {
this.code = rsp.code();
+ this.url = rsp.request().url().uri().toString();
}
public int code() {
@@ -19,6 +21,6 @@
@Override
public String getMessage() {
- return "Code: " + Integer.toString(code);
+ return "Code: " + Integer.toString(code) + ", URL: " + url;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/374818
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a64f6ace03e1cf5f1325abb5828ee8e40bbb908
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits