This commit is contained in:
xiangwbs
2018-03-20 22:25:27 +08:00
parent f20cb596cd
commit 4707718692
@@ -2,6 +2,7 @@ package com.xwbing.handler;
import com.alibaba.fastjson.JSONObject;
import com.xwbing.exception.BusinessException;
import com.xwbing.exception.UtilException;
import com.xwbing.util.JsonResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,6 +50,20 @@ public class GlobalExceptionHandler {
return JsonResult.toJSONObj(ex.getMessage());
}
/**
* 自定义工具类异常
*
* @param ex
* @return
*/
@ExceptionHandler(value = UtilException.class)
@ResponseStatus(value = HttpStatus.OK)
@ResponseBody
public JSONObject handlerUtilException(UtilException ex) {
logger.error(ex.getMessage());
return JsonResult.toJSONObj(ex.getMessage());
}
/**
* CompletableFuture完成结果或任务过程中出现的异常
*