提交 b45b4e2a authored 作者: 000516's avatar 000516 提交者: Coding

捕获异常添加SQL异常

捕获异常添加SQL异常
package com.sfa.common.security.handler;
import javax.servlet.http.HttpServletRequest;
import com.sfa.common.core.domain.R;
import com.sfa.common.core.exception.WXLSQLException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
......@@ -163,4 +166,13 @@ public class GlobalExceptionHandler
{
return AjaxResult.error("演示模式,不允许操作");
}
/**
* DB唯一值重复
*/
@ExceptionHandler(WXLSQLException.class)
public R handleWXLSQLException(WXLSQLException e)
{
return R.fail(e.getCode(),e.getMsg());
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论