类 GlobalExceptionHandler


  • @ControllerAdvice
    public class GlobalExceptionHandler
    extends java.lang.Object
    Global exception handler.
    作者:
    Nacos
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      org.springframework.http.ResponseEntity<java.lang.String> handleDataAccessException​(org.springframework.dao.DataAccessException ex)
      For DataAccessException.
      org.springframework.http.ResponseEntity<java.lang.String> handleIllegalArgumentException​(java.lang.Exception ex)
      For IllegalArgumentException, we are returning void with status code as 400, so our error-page will be used in this case.
      org.springframework.http.ResponseEntity<java.lang.String> handleNacosException​(com.alibaba.nacos.api.exception.NacosException ex)
      For NacosException.
      • 从类继承的方法 java.lang.Object

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

      • GlobalExceptionHandler

        public GlobalExceptionHandler()
    • 方法详细资料

      • handleIllegalArgumentException

        @ExceptionHandler(java.lang.IllegalArgumentException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleIllegalArgumentException​(java.lang.Exception ex)
                                                                                                 throws java.io.IOException
        For IllegalArgumentException, we are returning void with status code as 400, so our error-page will be used in this case.
        抛出:
        java.lang.IllegalArgumentException - IllegalArgumentException.
        java.io.IOException
      • handleNacosException

        @ExceptionHandler(com.alibaba.nacos.api.exception.NacosException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleNacosException​(com.alibaba.nacos.api.exception.NacosException ex)
                                                                                       throws java.io.IOException
        For NacosException.
        抛出:
        com.alibaba.nacos.api.exception.NacosException - NacosException.
        java.io.IOException
      • handleDataAccessException

        @ExceptionHandler(org.springframework.dao.DataAccessException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleDataAccessException​(org.springframework.dao.DataAccessException ex)
                                                                                            throws org.springframework.dao.DataAccessException
        For DataAccessException.
        抛出:
        org.springframework.dao.DataAccessException - DataAccessException.