diff --git a/src/main/java/org/hankki/hankkiserver/api/advice/GlobalExceptionHandler.java b/src/main/java/org/hankki/hankkiserver/api/advice/GlobalExceptionHandler.java index 31bd8bb1..e012795d 100644 --- a/src/main/java/org/hankki/hankkiserver/api/advice/GlobalExceptionHandler.java +++ b/src/main/java/org/hankki/hankkiserver/api/advice/GlobalExceptionHandler.java @@ -4,6 +4,7 @@ import org.hankki.hankkiserver.api.dto.HankkiResponse; import org.hankki.hankkiserver.common.code.BusinessErrorCode; import org.hankki.hankkiserver.common.exception.BadRequestException; +import org.hankki.hankkiserver.common.exception.ConflictException; import org.hankki.hankkiserver.common.exception.NotFoundException; import org.hankki.hankkiserver.common.exception.UnauthorizedException; @@ -32,6 +33,12 @@ public HankkiResponse handleEntityNotFoundException(NotFoundException e) { return HankkiResponse.fail(e.getErrorCode()); } + @ExceptionHandler(ConflictException.class) + public HankkiResponse handleConflictException(ConflictException e) { + log.error("handleConflictException() in GlobalExceptionHandler throw ConflictException : {}", e.getMessage()); + return HankkiResponse.fail(e.getErrorCode()); + } + @ExceptionHandler(Exception.class) public HankkiResponse handleException(Exception e) { log.error("handleException() in GlobalExceptionHandler throw Exception : {}", e.getMessage());