KKSU
2024-04-17 d23645e976981bc9b670eea1d469fe8a36be309c
src/main/java/com/xcong/excoin/common/aop/ExceptionCatchAspect.java
@@ -1,5 +1,6 @@
package com.xcong.excoin.common.aop;
import cn.hutool.http.HttpException;
import com.xcong.excoin.common.exception.GlobalException;
import com.xcong.excoin.common.system.bean.SysExceptionDetailEntity;
import com.xcong.excoin.modules.platform.dao.SysExceptionDetailDao;
@@ -17,6 +18,7 @@
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.client.ResourceAccessException;
import javax.net.ssl.SSLException;
import javax.validation.ValidationException;
@@ -51,7 +53,7 @@
    @AfterThrowing(pointcut = "exceptionCatch()", throwing = "ex")
    public void afterThrows(JoinPoint jp, Exception ex) throws Exception {
        if (ex instanceof GlobalException || ex instanceof MethodArgumentNotValidException || ex instanceof ValidationException || ex instanceof DuplicateKeyException || ex instanceof BadCredentialsException || ex instanceof UsernameNotFoundException || ex instanceof SSLException) {
        if (ex instanceof HttpException || ex instanceof ResourceAccessException || ex instanceof GlobalException || ex instanceof MethodArgumentNotValidException || ex instanceof ValidationException || ex instanceof DuplicateKeyException || ex instanceof BadCredentialsException || ex instanceof UsernameNotFoundException || ex instanceof SSLException) {
            throw ex;
        }
@@ -73,7 +75,7 @@
                    exceptionData.setSimpleMsg(ex.getMessage());
                    sysExceptionDetailDao.insert(exceptionData);
                    DingTalkUtils.sendMsg(profiles + "--" + ex.getMessage(), exStr.substring(0, 200), exceptionData.getId());
//                    DingTalkUtils.sendMsg(profiles + "--" + ex.getMessage(), exStr.substring(0, 200), exceptionData.getId());
                } catch (Exception e) {
                    log.error("exception aop", e);
                }