diff --git a/cs-restful/src/main/java/com/cf/cs/restful/exception/ControllerExceptionHandler.java b/cs-restful/src/main/java/com/cf/cs/restful/exception/ControllerExceptionHandler.java index 7c93fbf..a88a93d 100644 --- a/cs-restful/src/main/java/com/cf/cs/restful/exception/ControllerExceptionHandler.java +++ b/cs-restful/src/main/java/com/cf/cs/restful/exception/ControllerExceptionHandler.java @@ -23,9 +23,20 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +/** + * The type Controller exception handler. + * + * @author xajhuang @163.com + */ @ControllerAdvice @Slf4j public class ControllerExceptionHandler { + /** + * Controller not found protocol resp. + * + * @param e the e + * @return the protocol resp + */ @ExceptionHandler(NoHandlerFoundException.class) @ResponseStatus(HttpStatus.NOT_FOUND) @ResponseBody @@ -38,6 +49,12 @@ public class ControllerExceptionHandler { errMsg.toArray(new String[0])); } + /** + * Controller global exception protocol resp. + * + * @param e the e + * @return the protocol resp + */ @ExceptionHandler({MethodArgumentNotValidException.class}) @ResponseBody public ProtocolResp controllerGlobalException(MethodArgumentNotValidException e) { @@ -52,6 +69,12 @@ public class ControllerExceptionHandler { errMsg.toArray(new String[0])); } + /** + * Common error exception protocol resp. + * + * @param ex the ex + * @return the protocol resp + */ @ExceptionHandler({CommonErrorCodeException.class}) @ResponseBody public ProtocolResp commonErrorException(Exception ex) { @@ -60,6 +83,14 @@ public class ControllerExceptionHandler { new String[] {ex.getMessage()}); } + /** + * Handle exception protocol resp. + * + * @param rsp the rsp + * @param req the req + * @param ex the ex + * @return the protocol resp + */ @ExceptionHandler(SecurityProtocolException.class) @ResponseBody public ProtocolResp handleException(HttpServletResponse rsp,