mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
✨ 增加异常处理器,细化异常提示
This commit is contained in:
@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
/**
|
||||
* 全局异常处理器
|
||||
* @author zhaojun
|
||||
@@ -106,6 +108,17 @@ public class GlobleExceptionHandler {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 登录异常拦截器
|
||||
*/
|
||||
@ExceptionHandler(ConnectException.class)
|
||||
@ResponseBody
|
||||
public ResultBean handlerConnectException(ConnectException e) {
|
||||
return ResultBean.error("请求失败, 清稍后再试");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ExceptionHandler
|
||||
@ResponseBody
|
||||
@ResponseStatus
|
||||
|
||||
Reference in New Issue
Block a user