optimize(ebom): 优化错误提示

This commit is contained in:
曹鹏飞 2024-06-18 15:32:56 +08:00
parent ea95483620
commit 7dec2c1198
1 changed files with 5 additions and 2 deletions

View File

@ -124,9 +124,12 @@ public class BaseGlobalExceptionHandle {
@ResponseBody @ResponseBody
public ResultVO<String> handleRuntimeExceptionException(RuntimeException e) { public ResultVO<String> handleRuntimeExceptionException(RuntimeException e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
//throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员"); if (StrUtil.isNotBlank(e.getMessage()) && e.getMessage().contains("Deadlock")) {
return ResultVO.error("操作失败,请重试");
} else {
return ResultVO.error("系统错误,请联系管理员"); return ResultVO.error("系统错误,请联系管理员");
} }
}
@ExceptionHandler(value = BadSqlGrammarException.class) @ExceptionHandler(value = BadSqlGrammarException.class)
@ResponseBody @ResponseBody