Response的onFailure参数修改为HttpException

This commit is contained in:
huangzhuanghua
2017-01-11 12:00:20 +08:00
parent 93ec154b7e
commit a8a9e58fe9
42 changed files with 162 additions and 277 deletions

View File

@ -48,13 +48,10 @@ public class PostCommentUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
addCommentData(context, newsId, content, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
addCommentData(context, newsId, content, false, listener);
return;
}
if (listener != null){
listener.postFailed(e);
@ -83,13 +80,10 @@ public class PostCommentUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
addCommentVoto(context, commentId, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
addCommentVoto(context, commentId, false, listener);
return;
}
if (listener != null) {
listener.postFailed(e);
@ -117,12 +111,10 @@ public class PostCommentUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
if (((HttpException) e).code() == 401) {
addReportData(context, reportData, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
addReportData(context, reportData, false, listener);
return;
}
listener.postFailed(e);
}