Skip to content

Commit

Permalink
FIX: (#145) 사용자 도메인 예외 계층을 추가한다
Browse files Browse the repository at this point in the history
  • Loading branch information
anxi01 committed Feb 20, 2025
1 parent a3bbb84 commit 2fbba94
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/com/zerozero/user/exception/UserErrorType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.zerozero.user.exception;

import com.zerozero.core.support.error.ErrorType;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;

@Getter
@RequiredArgsConstructor
public enum UserErrorType implements ErrorType {
NOT_EXIST_USER(HttpStatus.NOT_FOUND, "존재하지 않는 사용자입니다."),
NOT_COMPLETED_MEMBER(HttpStatus.FORBIDDEN, "회원가입이 완료되지 않은 사용자입니다."),
ALREADY_REGISTERED_USER(HttpStatus.BAD_REQUEST, "이미 회원가입이 완료된 사용자입니다."),
;

private final HttpStatus status;

private final String message;
}
15 changes: 15 additions & 0 deletions src/main/java/com/zerozero/user/exception/UserException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.zerozero.user.exception;

import com.zerozero.core.support.error.CoreException;
import com.zerozero.core.support.error.ErrorType;

public class UserException extends CoreException {

public UserException(ErrorType errorType) {
super(errorType);
}

public UserException(ErrorType errorType, Object data) {
super(errorType, data);
}
}

0 comments on commit 2fbba94

Please sign in to comment.