Skip to content

Commit 083b793

Browse files
committed
feat: Follow 예외 정의
1 parent 99881e7 commit 083b793

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.example.log4u.domain.follow.exception;
2+
3+
import org.springframework.http.HttpStatus;
4+
5+
import com.example.log4u.common.exception.base.ErrorCode;
6+
7+
import lombok.Getter;
8+
import lombok.RequiredArgsConstructor;
9+
10+
@Getter
11+
@RequiredArgsConstructor
12+
public enum FollowErrorCode implements ErrorCode {
13+
FOLLOW_NOT_FOUND(HttpStatus.NOT_FOUND, "팔로우 정보가 존재하지 않습니다."),
14+
FOLLOWER_NOT_FOUND(HttpStatus.NOT_FOUND, "팔로워 정보가 존재하지 않습니다.");
15+
16+
private final HttpStatus httpStatus;
17+
private final String message;
18+
19+
@Override
20+
public HttpStatus getHttpStatus() {
21+
return httpStatus;
22+
}
23+
24+
@Override
25+
public String getErrorMessage() {
26+
return message;
27+
}
28+
}
29+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.example.log4u.domain.follow.exception;
2+
3+
import com.example.log4u.common.exception.base.ServiceException;
4+
5+
public class FollowNotFoundException extends ServiceException {
6+
public FollowNotFoundException() {
7+
super(FollowErrorCode.FOLLOW_NOT_FOUND);
8+
}
9+
}

0 commit comments

Comments
 (0)