jenkins-bot has submitted this change and it was merged. ( 
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(-)

Approvals:
  jenkins-bot: Verified
  Cooltey: Looks good to me, approved



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: merged
Gerrit-Change-Id: I8a64f6ace03e1cf5f1325abb5828ee8e40bbb908
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Cooltey <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Sharvaniharan <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to