Skip to content

Commit

Permalink
수신자 지정 예외처리 fixㅇ
Browse files Browse the repository at this point in the history
최경환 authored and 최경환 committed Dec 21, 2024
1 parent a6cc8b5 commit dbcad25
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -28,7 +28,9 @@ public enum ErrorStatus implements BaseErrorCode {
KEYWORD_NOT_FOUND(HttpStatus.BAD_REQUEST, "KEYWORD4001", "해당 키워드가 없습니다."),

// 이미지 업로드 관련 에러
IMAGE_UPLOAD_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "IMAGE5001", "이미지 업로드에 실패했습니다.");
IMAGE_UPLOAD_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "IMAGE5001", "이미지 업로드에 실패했습니다."),

EMAIL_MEMBER_NOT_FOUND(HttpStatus.BAD_REQUEST, "MEMBER404", "해당 이메일의 회원을 찾을 수 없습니다.");

private final HttpStatus httpStatus;
private final String code;
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ public Page<Letter> getMarkedLetterList(Long memberId, Integer page){
@Override
public Member getMemberByEmail(String email){
return memberRepository.findByEmail(email)
.orElseThrow(() -> new MemberHandler(ErrorStatus.MEMBER_NOT_FOUND));
.orElseThrow(() -> new MemberHandler(ErrorStatus.EMAIL_MEMBER_NOT_FOUND));
}

}
Original file line number Diff line number Diff line change
@@ -46,7 +46,6 @@ public static class SendLetterRequestDTO { // 편지 전송 요청 DTO
@Setter
public static class ReceiverRequestDTO{ // 수신자 지정 요청 DTO
@NotBlank(message = "수신자 이메일은 필수입니다.")
@Email(message = "유효한 이메일 주소여야 합니다.")
private String receiverEmail;
}
}

0 comments on commit dbcad25

Please sign in to comment.