提交 f41f5f93 编写于 作者: 门心叼龙's avatar 门心叼龙

exception update

上级 4fb61b55
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="ARRANGEMENT_SETTINGS_MIGRATED_TO_191" value="true" />
</AndroidXmlCodeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
......
......@@ -39,7 +39,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -24,11 +24,10 @@ public class ExceptionHandler {
ResponseThrowable ex;
if (e instanceof HttpException) {
HttpException httpException = (HttpException) e;
ex = new ResponseThrowable(e, SYSTEM_ERROR.HTTP_ERROR);
ex = new ResponseThrowable(e, httpException.code());
switch (httpException.code()) {
case SYSTEM_ERROR.UNAUTHORIZED:
ex.message = "操作未授权";
ex.code = SYSTEM_ERROR.UNAUTHORIZED;
Toast.makeText(RetrofitManager.mContext,"您的登录已失效,请重新登录",Toast.LENGTH_SHORT).show();
break;
case SYSTEM_ERROR.FORBIDDEN:
......
package com.fly.tour.test.presenter;
/**
* Description: <Test><br>
* Author: mxdl<br>
* Date: 2020/3/9<br>
* Version: V1.0.0<br>
* Update: <br>
*/
public class Test {
public static void main(String[] args) {
Test test = new Test();
try {
System.out.println(test.test());
System.out.println("ok");
}catch (Exception e){
System.out.println("error");
}
}
public String test() {
System.out.println("00000");
if (true)
throw new RuntimeException("small bug");
System.out.println("22222");
return "ok";
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册