类 SecurityGlobalExceptionHandler
java.lang.Object
cn.herodotus.engine.oauth2.core.exception.SecurityGlobalExceptionHandler
Description: 统一异常处理器
- 作者:
- : gengwei.zheng
- Date:
- : 2019/11/18 8:12
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static cn.herodotus.engine.assistant.definition.domain.Result<String>authenticationException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 统一异常处理 AuthenticationExceptionstatic cn.herodotus.engine.assistant.definition.domain.Result<String>exception(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) static cn.herodotus.engine.assistant.definition.domain.Result<String>oAuth2AuthenticationException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) static cn.herodotus.engine.assistant.definition.domain.Result<String>resolveException(Exception ex, String path) static cn.herodotus.engine.assistant.definition.domain.Result<String>resolveSecurityException(Exception exception, String path) 静态解析认证异常static cn.herodotus.engine.assistant.definition.domain.Result<String>restTemplateException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Rest Template 错误处理static cn.herodotus.engine.assistant.definition.domain.Result<String>validationBindException(org.springframework.validation.BindException ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) static cn.herodotus.engine.assistant.definition.domain.Result<String>validationMethodArgumentException(org.springframework.web.bind.MethodArgumentNotValidException ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
-
构造器详细资料
-
SecurityGlobalExceptionHandler
public SecurityGlobalExceptionHandler()
-
-
方法详细资料
-
restTemplateException
@ExceptionHandler({org.springframework.web.client.HttpClientErrorException.class,org.springframework.web.client.HttpServerErrorException.class}) public static cn.herodotus.engine.assistant.definition.domain.Result<String> restTemplateException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Rest Template 错误处理- 参数:
ex- 错误request- 请求response- 响应- 返回:
- Result 对象
- 另请参阅:
-
validationMethodArgumentException
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public static cn.herodotus.engine.assistant.definition.domain.Result<String> validationMethodArgumentException(org.springframework.web.bind.MethodArgumentNotValidException ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
validationBindException
@ExceptionHandler(org.springframework.validation.BindException.class) public static cn.herodotus.engine.assistant.definition.domain.Result<String> validationBindException(org.springframework.validation.BindException ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
authenticationException
@ExceptionHandler({org.springframework.security.core.AuthenticationException.class,PlatformAuthenticationException.class}) public static cn.herodotus.engine.assistant.definition.domain.Result<String> authenticationException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 统一异常处理 AuthenticationException- 参数:
ex- 错误request- 请求response- 响应- 返回:
- Result 对象
-
oAuth2AuthenticationException
@ExceptionHandler(org.springframework.security.oauth2.core.OAuth2AuthenticationException.class) public static cn.herodotus.engine.assistant.definition.domain.Result<String> oAuth2AuthenticationException(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
exception
@ExceptionHandler({java.lang.Exception.class,cn.herodotus.engine.assistant.definition.exception.PlatformRuntimeException.class}) public static cn.herodotus.engine.assistant.definition.domain.Result<String> exception(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) -
resolveException
-
resolveSecurityException
public static cn.herodotus.engine.assistant.definition.domain.Result<String> resolveSecurityException(Exception exception, String path) 静态解析认证异常- 参数:
exception- 错误信息- 返回:
- Result 对象
-