Response的onFailure参数修改为HttpException
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user