File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/main/java/cn/jpush/api/common/resp Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 99import org .slf4j .Logger ;
1010import org .slf4j .LoggerFactory ;
1111
12+ import java .util .Scanner ;
13+
1214public class ResponseWrapper {
1315 private static final Logger LOG = LoggerFactory .getLogger (ResponseWrapper .class );
1416 private static final int RESPONSE_CODE_NONE = -1 ;
@@ -48,7 +50,7 @@ public void setErrorObject() {
4850 if ( element instanceof JsonArray ) {
4951 JsonArray array = (JsonArray ) element ;
5052 for (int i = 0 ; i < array .size (); i ++) {
51- if (array .get (i ).getAsString ().contains ("error" )) {
53+ if (array .get (i ).getAsJsonObject ().has ("error" )) {
5254 errorObj = array .get (i ).getAsJsonObject ();
5355 break ;
5456 }
@@ -91,15 +93,15 @@ public String toString() {
9193 return _gson .toJson (this );
9294 }
9395
94- public class ErrorObject {
96+ public static class ErrorObject {
9597 public long msg_id ;
96- public ErrorEntity error ;
98+ public ErrorEntity error ;
9799 }
98100
99- public class ErrorEntity {
101+ public static class ErrorEntity {
100102 public int code ;
101103 public String message ;
102-
104+
103105 @ Override
104106 public String toString () {
105107 return _gson .toJson (this );
You can’t perform that action at this time.
0 commit comments