Skip to content

Commit

Permalink
HttpMaster增加解析异常向客户端的回调
Browse files Browse the repository at this point in the history
  • Loading branch information
XinYiWorld committed Jun 6, 2017
1 parent 650b776 commit 9784e37
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
*/
public interface I_HttpResultHandler{
<T> void onSuccess(int requestCode, BaseHttpResponseBean codeInfoBean,T successBean);
void onFailure(int requestCode,Throwable e);
void setState(View v, boolean b); //设置发起http的view是否可以点击
}
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,9 @@ public void readyGoForResult(Class<?> clazz, int requestCode) {
public void readyGoForResult(Class<?> clazz, int requestCode, Bundle bundle) {
navigateMaster.readyGoForResult(clazz, requestCode, bundle);
}

@Override
public void onFailure(int requestCode, Throwable e) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,9 @@ public void readyGoForResult(Class<?> clazz, int requestCode) {
public void readyGoForResult(Class<?> clazz, int requestCode, Bundle bundle) {
navigateMaster.readyGoForResult(clazz, requestCode, bundle);
}

@Override
public void onFailure(int requestCode, Throwable e) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ public void onError(Throwable e) {
hideProgressView();
ToastUtil.shortT(mContext,"解析数据异常!");
e.printStackTrace();
httpResultHandler.onFailure(getRequestCode(), e);
}

@Override
Expand Down Expand Up @@ -428,6 +429,7 @@ public void onError(Throwable e) {
hideProgressView();
ToastUtil.shortT(mContext,"解析数据异常!");
e.printStackTrace();
httpResultHandler.onFailure(getRequestCode(), e);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public <T> void onSuccess(int requestCode, BaseHttpResponseBean codeInfoBean, T
}
}

@Override
public void onFailure(int requestCode, Throwable e) {

}


//注册回调成功处理站
public <T> void onRegistSuccess(BaseHttpResponseBean codeInfoBean, UserBean user) {
Expand Down

0 comments on commit 9784e37

Please sign in to comment.