类 ResponseExceptionHandler


  • @ControllerAdvice
    public class ResponseExceptionHandler
    extends java.lang.Object
    Response exception handler.
    作者:
    nkorange
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      org.springframework.http.ResponseEntity<java.lang.String> handleException​(java.lang.Exception e)
      Handle other exception.
      org.springframework.http.ResponseEntity<java.lang.String> handleMissingParams​(org.springframework.web.bind.MissingServletRequestParameterException ex)
      Handle missing request parameter exception.
      org.springframework.http.ResponseEntity<java.lang.String> handleNacosException​(com.alibaba.nacos.api.exception.NacosException e)
      Handle NacosException.
      org.springframework.http.ResponseEntity<java.lang.String> handleParameterError​(java.lang.IllegalArgumentException ex)
      Handle IllegalArgumentException.
      • 从类继承的方法 java.lang.Object

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

      • ResponseExceptionHandler

        public ResponseExceptionHandler()
    • 方法详细资料

      • handleNacosException

        @ExceptionHandler(com.alibaba.nacos.api.exception.NacosException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleNacosException​(com.alibaba.nacos.api.exception.NacosException e)
        Handle NacosException.
        参数:
        e - NacosException
        返回:
        ResponseEntity
      • handleParameterError

        @ExceptionHandler(java.lang.IllegalArgumentException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleParameterError​(java.lang.IllegalArgumentException ex)
        Handle IllegalArgumentException.
        参数:
        ex - IllegalArgumentException
        返回:
        ResponseEntity
      • handleMissingParams

        @ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleMissingParams​(org.springframework.web.bind.MissingServletRequestParameterException ex)
        Handle missing request parameter exception.
        参数:
        ex - MissingServletRequestParameterException
        返回:
        ResponseEntity
      • handleException

        @ExceptionHandler(java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<java.lang.String> handleException​(java.lang.Exception e)
        Handle other exception.
        参数:
        e - other exception
        返回:
        ResponseEntity