Skip to content

Commit 9bc7deb

Browse files
authored
Merge pull request #495 from qiniu/update_exception
update qiniu exception
2 parents c045cd4 + cda5259 commit 9bc7deb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/qiniu/common/QiniuException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ public QiniuException(Exception e) {
2626
}
2727

2828
public QiniuException(Exception e, String msg) {
29-
super(msg, e);
29+
super(msg != null ? msg : (e != null ? e.getMessage() : null), e);
3030
this.response = null;
3131
this.error = msg;
3232
}
3333

3434
public String url() {
35-
return response.url();
35+
return response != null ? response.url() : "";
3636
}
3737

3838
public int code() {
39-
return response == null ? -1 : response.statusCode;
39+
return response != null ? response.statusCode : -1;
4040
}
4141

4242
public String error() {

0 commit comments

Comments
 (0)