Skip to content

Commit

Permalink
fix: 에러 타입 일반화하여 수정 (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywonchae1 committed Nov 23, 2024
1 parent 7f76258 commit 5b0b61e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void validateMaster(Long memberId, Long groupId) {
() -> new NotFoundException(GroupErrorType.GROUP_MEMBER_NOT_FOUND));
// Member가 Master인지 확인 -> 아니면 에러
if (groupMemberEntity.getRole() != GroupMemberRole.ROLE_MASTER) {
throw new BadRequestException(GroupErrorType.ONLY_MASTER_UPDATE_CCTV_NICKNAME);
throw new BadRequestException(GroupErrorType.ONLY_MASTER);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public enum GroupErrorType implements ErrorTypeCode {
ONLY_MASTER_REMOVE_GROUP_MASTER("BAD REQUEST", "방장은 자신을 제외시킬 수 있습니다."),
GROUP_MEMBER_NOT_FOUND("GROUP MEMBER NOT FOUND", "그룹 회원 정보를 찾을 수 없습니다."),
ONLY_MASTER_GET_GROUP_MEMBER_INFO("BAD REQUEST", "방장만 그룹 참여자 정보를 받을 수 있습니다."),
ONLY_MASTER_UPDATE_CCTV_NICKNAME("BAD REQUEST", "방장만 그룹의 CCTV 이름을 변경할 수 있습니다.");
ONLY_MASTER_UPDATE_CCTV_NICKNAME("BAD REQUEST", "방장만 그룹의 CCTV 이름을 변경할 수 있습니다."),
ONLY_MASTER("BAD REQUEST", "방장 권한이 없습니다.");

private final String message;
private final String description;
Expand Down

0 comments on commit 5b0b61e

Please sign in to comment.