标签:pre highlight lex classname 指针 ret 算数 tac 下标越界
/** * @author wen.jie * @Classname GlobalExceptionHandler * @Description 统一异常处理 * @Date 2020/6/27 */ @Slf4j @RestControllerAdvice public class GlobalExceptionHandler { @ExceptionHandler(value = {ArithmeticException.class}) public Object handlerException(Exception e){ log.info(Arrays.toString(e.getStackTrace())); return new CommonResult().failed("数学算数异常"); } @ExceptionHandler(value = {NullPointerException.class}) public Object handlerException2(Exception e){ log.info(Arrays.toString(e.getStackTrace())); return new CommonResult().failed("空指针异常"); } @ExceptionHandler(value = {IndexOutOfBoundsException.class}) public Object handlerException3(Exception e){ log.info(Arrays.toString(e.getStackTrace())); return new CommonResult().failed("下标越界异常"); } }
标签:pre highlight lex classname 指针 ret 算数 tac 下标越界
原文地址:https://www.cnblogs.com/wwjj4811/p/13199964.html