File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
src/main/java/com/leets/X/domain/post/exception Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
1
package com .leets .X .domain .post .exception ;
2
2
3
+ import lombok .AllArgsConstructor ;
4
+ import lombok .Getter ;
5
+
6
+ @ Getter
7
+ @ AllArgsConstructor
3
8
public enum ErrorMessage {
9
+
10
+ POST_NOT_FOUND (404 ,"존재하지 않는 게시글입니다." );
11
+
12
+ private final int code ;
13
+ private final String message ;
14
+
4
15
}
Original file line number Diff line number Diff line change 1
1
package com .leets .X .domain .post .exception ;
2
2
3
- public class PostNotFoundExceptiom {
4
- public class PostNotFoundException extends RuntimeException {
5
- public PostNotFoundException (String message ) {
6
- super (message );
7
- }
3
+ public class PostNotFoundException extends RuntimeException {
4
+
5
+ public PostNotFoundException () {
6
+ super ("해당 게시글을 찾을 수 없습니다." );
7
+ }
8
+
9
+ // 사용자 정의 메시지를 받을 수 있는 생성자
10
+ public PostNotFoundException (String message ) {
11
+ super (message );
8
12
}
13
+
9
14
}
You can’t perform that action at this time.
0 commit comments