Skip to content

Commit

Permalink
[#43] refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyoungchoi95 committed Sep 6, 2021
1 parent 5b8e813 commit f4a418a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/com/study/realworld/global/error/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,19 @@

public enum ErrorCode {

USER_NOT_FOUND(HttpStatus.BAD_REQUEST, "user is not found"),

EMAIL_DUPLICATION(HttpStatus.CONFLICT, "Duplicated email exists."),
USERNAME_DUPLICATION(HttpStatus.CONFLICT, "Duplicated username exists."),

USER_NOT_FOUND(HttpStatus.BAD_REQUEST, "user is not found"),
PASSWORD_DISMATCH(HttpStatus.FORBIDDEN, "password is dismatch."),

INVALID_USERNAME_NULL(HttpStatus.BAD_REQUEST, "username must be provided."),
INVALID_USERNAME_LENGTH(HttpStatus.BAD_REQUEST, "username length must be less then 20 characters."),
INVALID_USERNAME_PATTERN(HttpStatus.BAD_REQUEST, "usernmae must be provided by limited pattern."),

INVALID_EMAIL_NULL(HttpStatus.BAD_REQUEST, "address must be provided."),
INVALID_EMAIL_PATTERN(HttpStatus.BAD_REQUEST, "address must be provided by limited pattern like '[email protected]'."),

INVALID_PASSWORD_NULL(HttpStatus.BAD_REQUEST, "password must be provided."),
INVALID_PASSWORD_LENGTH(HttpStatus.BAD_REQUEST, "password length must be between 6 and 20 characters."),

PASSWORD_DISMATCH(HttpStatus.FORBIDDEN, "password is dismatch.")
INVALID_PASSWORD_LENGTH(HttpStatus.BAD_REQUEST, "password length must be between 6 and 20 characters.")
;

private final HttpStatus httpStatus;
Expand Down

0 comments on commit f4a418a

Please sign in to comment.