mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-08 02:04:04 +08:00
优化redis的连接失败的错误提示
This commit is contained in:
parent
06da295d58
commit
8cf5bc0a6e
@ -17,6 +17,7 @@ package xyz.playedu.api.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.data.redis.RedisConnectionFailureException;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.validation.ObjectError;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
@ -48,6 +49,11 @@ public class ExceptionController {
|
||||
return JsonResponse.error(e.getMessage(), 1);
|
||||
}
|
||||
|
||||
@ExceptionHandler(RedisConnectionFailureException.class)
|
||||
public JsonResponse serviceExceptionHandler(RedisConnectionFailureException e) {
|
||||
return JsonResponse.error("redis服务连接失败", 500);
|
||||
}
|
||||
|
||||
@ExceptionHandler(HttpMessageNotReadableException.class)
|
||||
public JsonResponse serviceExceptionHandler(HttpMessageNotReadableException e) {
|
||||
log.error("error", e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user