类 SecurityGlobalExceptionHandler

java.lang.Object
cn.herodotus.engine.oauth2.core.exception.SecurityGlobalExceptionHandler

@RestControllerAdvice public class SecurityGlobalExceptionHandler extends Object

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)
    统一异常处理 AuthenticationException
    static 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>
     
    static cn.herodotus.engine.assistant.definition.domain.Result<String>
    静态解析认证异常
    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)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • 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.PlatformException.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

      public static cn.herodotus.engine.assistant.definition.domain.Result<String> resolveException(Exception ex, String path)
    • resolveSecurityException

      public static cn.herodotus.engine.assistant.definition.domain.Result<String> resolveSecurityException(Exception exception, String path)
      静态解析认证异常
      参数:
      exception - 错误信息
      返回:
      Result 对象