-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/com/zerozero/review/exception/ReviewErrorType.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,20 @@ | ||
package com.zerozero.review.exception; | ||
|
||
import com.zerozero.core.support.error.ErrorType; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum ReviewErrorType implements ErrorType { | ||
NOT_EXIST_DELETABLE_REVIEW(HttpStatus.BAD_REQUEST, "삭제 가능한 리뷰가 존재하지 않습니다."), | ||
USER_VALIDATION_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "리뷰를 작성한 사용자가 아닙니다."), | ||
ALREADY_USER_REVIEWED(HttpStatus.INTERNAL_SERVER_ERROR, "이미 리뷰를 작성한 사용자입니다."), | ||
NOT_EXIST_REVIEW(HttpStatus.BAD_REQUEST, "리뷰가 존재하지 않습니다."), | ||
; | ||
|
||
private final HttpStatus status; | ||
|
||
private final String message; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/zerozero/review/exception/ReviewException.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,15 @@ | ||
package com.zerozero.review.exception; | ||
|
||
import com.zerozero.core.support.error.CoreException; | ||
import com.zerozero.core.support.error.ErrorType; | ||
|
||
public class ReviewException extends CoreException { | ||
|
||
public ReviewException(ErrorType errorType) { | ||
super(errorType); | ||
} | ||
|
||
public ReviewException(ErrorType errorType, Object data) { | ||
super(errorType, data); | ||
} | ||
} |