-
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
4 changed files
with
57 additions
and
0 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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/server/capple/global/exception/errorCode/QuestionErrorCode.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,27 @@ | ||
package com.server.capple.global.exception.errorCode; | ||
|
||
import com.server.capple.global.exception.ErrorCode; | ||
import com.server.capple.global.exception.ErrorCodeInterface; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum QuestionErrorCode implements ErrorCodeInterface { | ||
EMPTY_QUESTION("QUESTION001", "존재하지 않는 질문입니다.", HttpStatus.BAD_REQUEST), | ||
; | ||
|
||
private final String code; | ||
private final String message; | ||
private final HttpStatus httpStatus; | ||
|
||
@Override | ||
public ErrorCode getErrorCode() { | ||
return ErrorCode.builder() | ||
.code(code) | ||
.message(message) | ||
.httpStatus(httpStatus) | ||
.build(); | ||
} | ||
} |