diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 681f41ae2aee4749eb4ddda94f8c6a76c825c825..632b2e0ee0faafede314ed0f7d5d4f2a939c1a97 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,8 @@ + + - + diff --git a/lib_fly_api/src/main/java/com/fly/tour/api/http/ExceptionHandler.java b/lib_fly_api/src/main/java/com/fly/tour/api/http/ExceptionHandler.java index 13796fdb595e54e96c2e73141c97904902b5d4bb..a992ebb71630b8d3b64fd88550a507a61fa1297e 100644 --- a/lib_fly_api/src/main/java/com/fly/tour/api/http/ExceptionHandler.java +++ b/lib_fly_api/src/main/java/com/fly/tour/api/http/ExceptionHandler.java @@ -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: diff --git a/module_test/src/main/java/com/fly/tour/test/presenter/Test.java b/module_test/src/main/java/com/fly/tour/test/presenter/Test.java new file mode 100644 index 0000000000000000000000000000000000000000..8cef7de5d20b786681a5dc54b65ad505994f7edf --- /dev/null +++ b/module_test/src/main/java/com/fly/tour/test/presenter/Test.java @@ -0,0 +1,29 @@ +package com.fly.tour.test.presenter; + +/** + * Description:
+ * Author: mxdl
+ * Date: 2020/3/9
+ * Version: V1.0.0
+ * Update:
+ */ +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"; + } +}