-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 예외 중앙처리 #11
The head ref may contain hidden characters: "feat-\uC608\uC678-\uC911\uC559\uCC98\uB9AC"
[FEAT] 예외 중앙처리 #11
Conversation
|
||
private String code; | ||
|
||
private String message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final 적용해도 될 것 같습니당
public ResponseEntity<ErrorResult> catchError(IllegalArgumentException e) { | ||
log.error("[exceptionHandle] ex", e); | ||
|
||
ErrorResult errorResult = new ErrorResult("BAD", e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분의 "BAD"를 HttpStatus.BAD_REQUEST.name()
으로 바꾸시면 될 것 같습니다!
|
||
import lombok.Data; | ||
|
||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaTa 어노테이션은 삭제해도 될 것 같아요! getter가 필요해도 setter는 생성하지 않는게 좋다고 생각합니다!!
|
||
import lombok.Data; | ||
|
||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생성자에서 데이터를 입력받은 후 수정이나 조회가 필요 없어서 @DaTa 는 없어도 될 것 같습니당
public ErrorResult(String code) { | ||
this.code = code; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ErrorResult(String code) { | |
this.code = code; | |
} | |
public ErrorResult(String code) { | |
this.code = code; | |
this.message = "bad request"; | |
} |
이렇게 수정하시면 record 사용가능 할 듯 합니다!
📌 과제 설명
👩💻 요구 사항과 구현 내용
✅ 피드백 반영사항
✅ PR 포인트 & 궁금한 점