Commit d614a946 by sikang

UPDATE

parent ca9f4d26
...@@ -56,14 +56,14 @@ public abstract class HttpObserver<T> implements Observer<T> { ...@@ -56,14 +56,14 @@ public abstract class HttpObserver<T> implements Observer<T> {
if (!isCanHandle(exception)) { if (!isCanHandle(exception)) {
String body = exception.response().errorBody().string(); String body = exception.response().errorBody().string();
ResponseErrorBody responseErrorBody = new Gson().fromJson(body, ResponseErrorBody.class); ResponseErrorBody responseErrorBody = new Gson().fromJson(body, ResponseErrorBody.class);
onError(Error.SERVER_ERROR, "Server Exception: " + responseErrorBody.getMessage()); onError(Error.SERVER_ERROR, responseErrorBody.getMessage());
} }
} else if (msg.contains("java.lang.IllegalStateException")) { } else if (msg.contains("java.lang.IllegalStateException")) {
onError(Error.APP_ERROR, "Program Exception"); onError(Error.APP_ERROR, "Program Exception");
} else if (msg.contains("body is null")) { } else if (msg.contains("body is null")) {
onSuccess(null); onSuccess(null);
} else { } else {
onError(Error.UNKNOW, "Unknow Exception: " + msg); onError(Error.UNKNOW, msg);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment