全局异常

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
@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) {