|
@@ -0,0 +1,31 @@
|
|
|
+package com.fuzamei.util;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+public class ExceptionHandler {
|
|
|
+ private ExceptionHandler() {
|
|
|
+ throw new AssertionError("instaniation is not permitted");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @Title: handleException
|
|
|
+ * @Description: TODO(针对所有的异常进行判断,并返回Map类型的异常的json数据)
|
|
|
+ * @param @param e
|
|
|
+ * @param @return 设定文件
|
|
|
+ * @return Map<String,Object> 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2018年1月29日 下午5:18:44
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ public static final Map<String, Object> handleException(Exception e){
|
|
|
+ String exceptionMSG=e.getMessage();
|
|
|
+ switch (exceptionMSG) {
|
|
|
+ case "":
|
|
|
+ return null;
|
|
|
+
|
|
|
+ default:
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|