Skip to content

Commit

Permalink
Merge pull request #56 from mju-likelion/feature/refactor-exception-c…
Browse files Browse the repository at this point in the history
…ode-#55

Feature/#55 지속적인 예외 코드 리팩터링
  • Loading branch information
Dh3356 authored Feb 17, 2024
2 parents cecde34 + 04f5902 commit ab44292
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@AllArgsConstructor
public enum ErrorCode {
//서버 내부 오류들
INTERNAL_SERVER_ERROR("INTERNAL 5000", "알 수 없는 서버 내부 오류"),//서버 내부 오류
INTERNAL_SERVER_ERROR("INTERNAL 5000", "알 수 없는 서버 내부 오류."),//서버 내부 오류
FILE_STORAGE_ERROR("INTERNAL 5001", "파일 저장에 실패하였습니다."),//파일 저장 실패
//잘못된 경로, 메소드 오류들
METHOD_NOT_ALLOWED_ERROR("METHOD 4050", "허용되지 않은 메소드 입니다."),//허용되지 않은 메소드
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ public enum ValidationErrorCode {
NOT_NULL("VALIDATION 9001", "필수값이 누락되었습니다."),
NOT_BLANK("VALIDATION 9002", "필수값이 빈 값이거나 공백으로 되어있습니다."),
REGEX("VALIDATION 9003", "형식에 맞지 않습니다."),
EMAIL("VALIDATION 9004", "이메일 형식에 맞지 않습니다."),
ENUM_CONSTRAINT("VALIDATION 9005", "유효하지 않은 Enum 값입니다."),
GRADE_CONSTRAINT("VALIDATION 9006", "학년이 형식에 맞지 않습니다.");
ENUM_CONSTRAINT("VALIDATION 9004", "유효하지 않은 Enum 값입니다."),
GRADE_CONSTRAINT("VALIDATION 9005", "학년이 형식에 맞지 않습니다.");


private final String code;
Expand All @@ -24,7 +23,6 @@ public static ValidationErrorCode resolveAnnotation(String code) {
case "NotNull" -> NOT_NULL;
case "NotBlank" -> NOT_BLANK;
case "Pattern" -> REGEX;
case "Email" -> EMAIL;
case "EnumConstraint" -> ENUM_CONSTRAINT;
case "GradeConstraint" -> GRADE_CONSTRAINT;
default -> throw new IllegalArgumentException("Unexpected value: " + code);
Expand Down

0 comments on commit ab44292

Please sign in to comment.