修复 空指针null问题
This commit is contained in:
parent
050a48b134
commit
a2e1acb66c
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.common.orm.handler;
|
package com.ruoyi.common.orm.handler;
|
||||||
|
|
||||||
import com.ruoyi.common.core.core.domain.R;
|
import com.ruoyi.common.core.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.MyBatisSystemException;
|
import org.mybatis.spring.MyBatisSystemException;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
@ -35,7 +36,7 @@ public class MybatisExceptionHandler {
|
|||||||
public R<Void> handleCannotFindDataSourceException(MyBatisSystemException e, HttpServletRequest request) {
|
public R<Void> handleCannotFindDataSourceException(MyBatisSystemException e, HttpServletRequest request) {
|
||||||
String requestURI = request.getRequestURI();
|
String requestURI = request.getRequestURI();
|
||||||
String message = e.getMessage();
|
String message = e.getMessage();
|
||||||
if ("CannotFindDataSourceException".contains(message)) {
|
if (StringUtils.contains("CannotFindDataSourceException", message)) {
|
||||||
log.error("请求地址'{}', 未找到数据源", requestURI);
|
log.error("请求地址'{}', 未找到数据源", requestURI);
|
||||||
return R.fail("未找到数据源,请联系管理员确认");
|
return R.fail("未找到数据源,请联系管理员确认");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user