Commit d614a946 by sikang

UPDATE

parent ca9f4d26
......@@ -56,14 +56,14 @@ public abstract class HttpObserver<T> implements Observer<T> {
if (!isCanHandle(exception)) {
String body = exception.response().errorBody().string();
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")) {
onError(Error.APP_ERROR, "Program Exception");
} else if (msg.contains("body is null")) {
onSuccess(null);
} 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