Skip to content

Commit

Permalink
feat: 아이디 찾기 예외 enum 정의(#28)
Browse files Browse the repository at this point in the history
- 인증 코드 내역이 존재하지 않는 경우(인증 코드 만료도 포함)
- 인증 코드가 일치하지 않는 경우
  • Loading branch information
Minjae-An committed Mar 16, 2024
1 parent 7cdf64e commit ebc6598
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions be/src/main/java/yeonba/be/exception/LoginException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package yeonba.be.exception;

import org.springframework.http.HttpStatus;

public enum LoginException implements BaseException {

VERIFICATION_CODE_NOT_FOUND(
HttpStatus.BAD_REQUEST,
"해당 인증 코드 내역이 존재하지 않습니다."),

VERIFICATION_CODE_NOT_MATCH(
HttpStatus.BAD_REQUEST,
"인증 코드가 일치하지 않습니다.");

private final HttpStatus httpStatus;
private final String reason;

LoginException(HttpStatus httpStatus, String reason) {
this.httpStatus = httpStatus;
this.reason = reason;
}

@Override
public HttpStatus getHttpStatus() {
return httpStatus;
}

@Override
public String getReason() {
return reason;
}
}

0 comments on commit ebc6598

Please sign in to comment.