zhang
2025-05-20 1313906bb1eb983d3beece810035e7fc28d6a92f
zy-acs-manager/src/main/java/com/zy/acs/manager/common/exception/GlobalExceptionHandler.java
@@ -1,5 +1,6 @@
package com.zy.acs.manager.common.exception;
import com.zy.acs.framework.exception.CoolException;
import com.zy.acs.manager.common.constant.Constants;
import com.zy.acs.manager.common.utils.CommonUtil;
import com.zy.acs.framework.common.R;
@@ -27,6 +28,7 @@
    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
    public R methodNotSupportedExceptionHandler(HttpRequestMethodNotSupportedException e,
                                                HttpServletResponse response) {
        e.printStackTrace();
        CommonUtil.addCrossHeaders(response);
        return R.error("请求方式不正确");
    }
@@ -46,6 +48,13 @@
    }
    @ResponseBody
    @ExceptionHandler(CoolException.class)
    public R coolExceptionHandler(CoolException e, HttpServletResponse response) {
        CommonUtil.addCrossHeaders(response);
        return R.error(e.getMessage());
    }
    @ResponseBody
    @ExceptionHandler(Throwable.class)
    public R exceptionHandler(Throwable e, HttpServletResponse response) {
        logger.error(e.getMessage(), e);