全局异常

This commit is contained in:
none 2023-04-19 16:50:36 +08:00
parent 3ca8350e97
commit d91b3ac20d

View File

@ -36,12 +36,12 @@ import java.util.List;
@RestControllerAdvice @RestControllerAdvice
@Slf4j @Slf4j
public class ExceptionController { public class ExceptionController {
//
// @ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
// public JsonResponse exceptionHandler(Exception e) { public JsonResponse exceptionHandler(Exception e) {
// log.error(e.getMessage()); log.error(e.getMessage());
// return JsonResponse.error("系统错误", 500); return JsonResponse.error("系统错误", 500);
// } }
@ExceptionHandler(ServiceException.class) @ExceptionHandler(ServiceException.class)
public JsonResponse serviceExceptionHandler(ServiceException e) { public JsonResponse serviceExceptionHandler(ServiceException e) {