全局异常捕获

This commit is contained in:
none 2023-05-31 09:57:31 +08:00
parent 8da402255c
commit 4689073d4f

View File

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