use of com.benmu.framework.http.okhttp.exception.CancelException in project WeexErosFramework by bmfe.
the class EventFetch method parseError.
private void parseError(Context context, Exception e, JSCallback callback) {
if (e instanceof CancelException) {
// request canceled
ModalManager.BmLoading.dismissLoading(context);
return;
}
AxiosResultBean bean = new AxiosResultBean();
if (e instanceof HttpException) {
HttpException httpException = (HttpException) e;
bean.status = httpException.getmErrorCode();
bean.errorMsg = httpException.getmErrorMessage();
} else if (e instanceof IrregularUrlException) {
IrregularUrlException irregularUrlException = (IrregularUrlException) e;
bean.status = 9;
bean.errorMsg = irregularUrlException.getmErrosMeeage();
}
if (callback != null) {
callback.invoke(bean);
}
}
Aggregations