-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 회원 도메인의 사용자에게 반환할 에러 메시지에 대한 책임을 사용자 정의 예외로 이동 (#106)
- Loading branch information
Showing
10 changed files
with
71 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
src/main/java/es/princip/getp/domain/member/command/exception/AlreadyUsedEmailException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package es.princip.getp.domain.member.command.exception; | ||
|
||
import es.princip.getp.infra.exception.BusinessLogicException; | ||
import es.princip.getp.infra.exception.ErrorDescription; | ||
|
||
public class AlreadyUsedEmailException extends BusinessLogicException { | ||
|
||
private static final String code = "ALREADY_USED_EMAIL"; | ||
private static final String message = "이미 사용 중인 이메일입니다."; | ||
|
||
public AlreadyUsedEmailException() { | ||
super("이미 사용 중인 이메일입니다."); | ||
super(ErrorDescription.of(code, message)); | ||
} | ||
} |
11 changes: 8 additions & 3 deletions
11
...va/es/princip/getp/domain/member/command/exception/FailedToSaveProfileImageException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package es.princip.getp.domain.member.command.exception; | ||
|
||
import es.princip.getp.infra.exception.BusinessLogicException; | ||
import es.princip.getp.infra.exception.ApiErrorException; | ||
import es.princip.getp.infra.exception.ErrorDescription; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public class FailedToSaveProfileImageException extends BusinessLogicException { | ||
public class FailedToSaveProfileImageException extends ApiErrorException { | ||
|
||
private static final String code = "FAILED_TO_SAVE_PROFILE_IMAGE"; | ||
private static final String message = "프로필 사진 저장에 실패했습니다. 다시 시도해주세요."; | ||
|
||
public FailedToSaveProfileImageException() { | ||
super("프로필 이미지를 저장하는데 실패했습니다."); | ||
super(HttpStatus.INTERNAL_SERVER_ERROR, ErrorDescription.of(code, message)); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/es/princip/getp/domain/member/command/exception/NotFoundMemberException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package es.princip.getp.domain.member.command.exception; | ||
|
||
import es.princip.getp.infra.exception.ErrorDescription; | ||
import es.princip.getp.infra.exception.NotFoundException; | ||
|
||
public class NotFoundMemberException extends NotFoundException { | ||
|
||
private static final String code = "NOT_FOUND_MEMBER"; | ||
private static final String message = "존재하지 않는 회원입니다."; | ||
|
||
public NotFoundMemberException() { | ||
super(ErrorDescription.of(code, message)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/es/princip/getp/domain/serviceTerm/exception/DuplicatedTagException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package es.princip.getp.domain.serviceTerm.exception; | ||
|
||
import es.princip.getp.infra.exception.BusinessLogicException; | ||
import es.princip.getp.infra.exception.ErrorDescription; | ||
|
||
public class DuplicatedTagException extends BusinessLogicException { | ||
|
||
private static final String code = "DUPLICATED_TAG"; | ||
private static final String message = "중복된 태그입니다."; | ||
|
||
public DuplicatedTagException() { | ||
super(ErrorDescription.of(code, message)); | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
...s/princip/getp/domain/serviceTerm/exception/NotAgreedAllRequiredServiceTermException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package es.princip.getp.domain.serviceTerm.exception; | ||
|
||
import es.princip.getp.infra.exception.BusinessLogicException; | ||
import es.princip.getp.infra.exception.ErrorDescription; | ||
|
||
public class NotAgreedAllRequiredServiceTermException extends BusinessLogicException { | ||
|
||
private static final String code = "NOT_AGREED_ALL_REQUIRED_SERVICE_TERM"; | ||
private static final String message = "모든 필수 서비스 약관에 동의하지 않았습니다."; | ||
|
||
public NotAgreedAllRequiredServiceTermException() { | ||
super("모든 필수 서비스 약관에 동의하지 않았습니다."); | ||
super(ErrorDescription.of(code, message)); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/es/princip/getp/domain/serviceTerm/exception/NotFoundServiceTermException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package es.princip.getp.domain.serviceTerm.exception; | ||
|
||
import es.princip.getp.infra.exception.ErrorDescription; | ||
import es.princip.getp.infra.exception.NotFoundException; | ||
|
||
public class NotFoundServiceTermException extends NotFoundException { | ||
|
||
private static final String code = "NOT_FOUND_SERVICE_TERM"; | ||
private static final String message = "존재하지 않는 서비스 약관입니다."; | ||
|
||
public NotFoundServiceTermException() { | ||
super(ErrorDescription.of(code, message)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters