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

@ -89,12 +89,9 @@ public class LibaoUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
getCunHaoXiang(context, false);
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
getCunHaoXiang(context, false);
}
}
});
@ -117,13 +114,10 @@ public class LibaoUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
postLibaoLing(context, libaoId, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
postLibaoLing(context, libaoId, false, listener);
return;
}
listener.postFailed(e);
}
@ -147,13 +141,10 @@ public class LibaoUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
postLibaoLing(context, libaoId, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
postLibaoLing(context, libaoId, false, listener);
return;
}
listener.postFailed(e);
}
@ -177,13 +168,10 @@ public class LibaoUtils {
}
@Override
public void onFailure(Throwable e) {
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 401) {
postLibaoLing(context, code, false, listener);
return;
}
public void onFailure(HttpException e) {
if (e != null && e.code() == 401) {
postLibaoLing(context, code, false, listener);
return;
}
listener.postFailed(e);
}
@ -201,7 +189,7 @@ public class LibaoUtils {
}
@Override
public void onFailure(Throwable e) {
public void onFailure(HttpException e) {
listener.postFailed(e);
}
});