Commit 5c4c7677 by huluobin

update

parent 68345dd2
...@@ -181,7 +181,6 @@ ...@@ -181,7 +181,6 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency> </dependency>
......
...@@ -4,6 +4,7 @@ package com.blt.other.common.exception; ...@@ -4,6 +4,7 @@ package com.blt.other.common.exception;
import com.bailuntec.common.JsonUtilByJackson; import com.bailuntec.common.JsonUtilByJackson;
import com.blt.other.common.interceptor.mail.MailService; import com.blt.other.common.interceptor.mail.MailService;
import com.blt.other.common.wrapper.RequestBakRequestWrapper; import com.blt.other.common.wrapper.RequestBakRequestWrapper;
import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -75,7 +76,7 @@ public class GlobalExceptionHandler { ...@@ -75,7 +76,7 @@ public class GlobalExceptionHandler {
* 数据库唯一键冲突异常 * 数据库唯一键冲突异常
*/ */
@ResponseBody @ResponseBody
@ExceptionHandler({SQLIntegrityConstraintViolationException.class}) @ExceptionHandler({SQLIntegrityConstraintViolationException.class, MySQLIntegrityConstraintViolationException.class})
public Map<String, Object> handleSQLIntegrityConstraintViolationException(HttpServletRequest request, public Map<String, Object> handleSQLIntegrityConstraintViolationException(HttpServletRequest request,
RuntimeException e) { RuntimeException e) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment