package org.wikipedia.dataclient.okhttp;

import android.support.annotation.NonNull;

import java.io.IOException;

import okhttp3.Response;

public class HttpStatusException extends IOException {
    private final int code;

    public HttpStatusException(@NonNull Response rsp) {
        this.code = rsp.code();
    }

    public int code() {
        return code;
    }

    @Override
    public String getMessage() {
        return "Code: " + Integer.toString(code);
    }
}

@@ -216,16 +216,46 @@
 nt code;
+%0A    private final String url;
 %0A%0A    pu
@@ -336,16 +336,73 @@
 code();%0A
+        this.url = rsp.request().url().uri().toString();%0A
     %7D%0A%0A 
@@ -495,24 +495,24 @@
 Message() %7B%0A
-
         retu
@@ -547,16 +547,34 @@
 ng(code)
+ + %22, URL: %22 + url
 ;%0A    %7D%0A

Include the request URL in an HttpStatusException message