| | |
| | | |
| | | public static HDLException getException(HDLException e) { |
| | | try { |
| | | return new HDLException(e.getCode(), getErrorSting(e.getCode()), e.getmExtra()); |
| | | String str = TextUtils.isEmpty(getErrorSting(e.getCode())) ? e.getMsg() : getErrorSting(e.getCode()); |
| | | return new HDLException(e.getCode(), str, e.getmExtra()); |
| | | } catch (Exception exception) { |
| | | return e; |
| | | } |
| | |
| | | try { |
| | | switch (code) { |
| | | case 1000: |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.http_unknown); |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.no_network_connection); |
| | | case 1001: |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.parse_error); |
| | | case 1002: |
| | |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.ssl_error); |
| | | case 1005: |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.timeout_error); |
| | | case 4: |
| | | return HDLApp.getInstance().getAppLocaleContext().getString(R.string.signature_error_log_in_again); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |