From a5f30b1ebeef915352f88d0d61be1ca9cd28a6c8 Mon Sep 17 00:00:00 2001 From: Parkjyun Date: Thu, 7 Mar 2024 20:28:34 +0900 Subject: [PATCH] [fix] change exception message --- .../java/org/pingle/pingleserver/dto/type/ErrorMessage.java | 1 + .../org/pingle/pingleserver/service/UserMeetingService.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/pingle/pingleserver/dto/type/ErrorMessage.java b/src/main/java/org/pingle/pingleserver/dto/type/ErrorMessage.java index 8bc0592..db7f019 100644 --- a/src/main/java/org/pingle/pingleserver/dto/type/ErrorMessage.java +++ b/src/main/java/org/pingle/pingleserver/dto/type/ErrorMessage.java @@ -40,6 +40,7 @@ public enum ErrorMessage { USER_NOT_FOUND(HttpStatus.NOT_FOUND, "사용자를 찾을 수 없습니다."), NOT_FOUND_END_POINT(HttpStatus.NOT_FOUND, "존재하지 않는 API입니다."), MEETING_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 번개입니다"), + USERMEETING_NOT_FOUND(HttpStatus.NOT_FOUND, "존재하지 않는 유저미팅입니다." ), // Method Not Allowed Error 405 METHOD_NOT_ALLOWED(HttpStatus.METHOD_NOT_ALLOWED, "지원하지 않는 메소드입니다."), // Conflict Error 409 diff --git a/src/main/java/org/pingle/pingleserver/service/UserMeetingService.java b/src/main/java/org/pingle/pingleserver/service/UserMeetingService.java index e3c0667..16d2bb2 100644 --- a/src/main/java/org/pingle/pingleserver/service/UserMeetingService.java +++ b/src/main/java/org/pingle/pingleserver/service/UserMeetingService.java @@ -56,7 +56,7 @@ public Long participateMeeting(Long userId, Long meetingId) { @Transactional public Long cancelMeeting(Long userId, Long meetingId) { UserMeeting userMeeting = userMeetingRepository.findByUserIdAndMeetingId(userId, meetingId) - .orElseThrow(() -> new CustomException(ErrorMessage.RESOURCE_NOT_FOUND)); + .orElseThrow(() -> new CustomException(ErrorMessage.USERMEETING_NOT_FOUND)); if(userMeetingRepository.existsByUserIdAndMeetingIdAndMeetingRole(userId, meetingId, MRole.OWNER)) throw new CustomException(ErrorMessage.BAD_REQUEST); userMeetingRepository.delete(userMeeting);