mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Added print exception to console
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user