Add URL to HttpException
This commit is contained in:
parent
c50519be82
commit
b1d5d959d4
|
@ -4,15 +4,24 @@ import java.io.IOException;
|
||||||
|
|
||||||
public class HttpException extends IOException {
|
public class HttpException extends IOException {
|
||||||
|
|
||||||
private int code;
|
private final String url;
|
||||||
private String msg;
|
private final int code;
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
public HttpException(int code, String msg) {
|
public HttpException(int code, String msg) {
|
||||||
super(code + " - " + msg);
|
super(code + " - " + msg);
|
||||||
|
this.url = "";
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HttpException(String url, int code, String msg) {
|
||||||
|
super(code + " - " + msg + " - " + url);
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
public int getResponseCode() {
|
public int getResponseCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -20,4 +29,8 @@ public class HttpException extends IOException {
|
||||||
public String getResponseMessage() {
|
public String getResponseMessage() {
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue