1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

Added print exception to console

This commit is contained in:
2023-05-18 12:34:21 +08:00
parent 48506be3fa
commit f14bd9ca3c

View File

@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
public class CustomExceptionHandler {
@ExceptionHandler(value = Exception.class)
public ResponseResult exceptionHandler(Exception e) {
e.printStackTrace();
if (e instanceof DuplicateKeyException) {
return ResponseResult.build(ResponseCode.DATABASE_SAVE_ERROR, "无法添加重复数据", null);
}