fix: 修复SQL异常详情没有输出到控制台的bug

This commit is contained in:
Captain.B 2021-03-18 15:02:24 +08:00
parent fec05d2ed0
commit d2466c364e
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package io.metersphere.controller.handler;
import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.ResultHolder;
import org.apache.shiro.ShiroException;
import org.apache.shiro.authz.UnauthorizedException;
@ -34,6 +35,7 @@ public class RestControllerExceptionHandler {
@ExceptionHandler(SQLException.class)
public ResultHolder sqlExceptionHandler(HttpServletRequest request, HttpServletResponse response, SQLException e) {
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
LogUtil.error(e);
return ResultHolder.error("SQL error happened, please check logs.");
}