Skip to content

Commit 78c4ed6

Browse files
author
Javen
committed
Fix bug - public msg_id from RequestException
1 parent e7fb83a commit 78c4ed6

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/cn/jpush/api/common/APIRequestException.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ public int getStatus() {
2121
return this.responseWrapper.responseCode;
2222
}
2323

24+
public long getMsgId() {
25+
ErrorObject eo = getErrorObject();
26+
if (null != eo) {
27+
return eo.msg_id;
28+
}
29+
return 0;
30+
}
31+
2432
public int getErrorCode() {
2533
ErrorObject eo = getErrorObject();
2634
if (null != eo) {

src/cn/jpush/api/common/ResponseWrapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public String toString() {
5050
}
5151

5252
public class ErrorObject {
53+
public long msg_id;
5354
public ErrorEntity error;
5455
}
5556

src/cn/jpush/api/examples/PushExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public static void testSendPush() {
5252
LOG.info("HTTP Status: " + e.getStatus());
5353
LOG.info("Error Code: " + e.getErrorCode());
5454
LOG.info("Error Message: " + e.getErrorMessage());
55+
LOG.info("Msg ID: " + e.getMsgId());
5556
}
5657
}
5758

0 commit comments

Comments
 (0)