调整不捕获异常

This commit is contained in:
wenc000 2020-08-12 16:42:51 +08:00
parent 5f18184362
commit 7c2cf7e570

View File

@ -8,6 +8,8 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import org.springframework.security.oauth2.provider.ClientRegistrationException;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@ -41,7 +43,9 @@ public class ClientExceptionAspect {
result = proceedingJoinPoint.proceed();
} catch (Throwable e) {
boolean exceptionFlag = e instanceof SystemException
|| e instanceof AuthenticationException;
|| e instanceof AuthenticationException
|| e instanceof OAuth2Exception
|| e instanceof ClientRegistrationException;
if (!exceptionFlag) {
new Thread(() -> {
exceptionServiceImpl.writeThrowable(e);