Skip to content
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: add exception handling to notification server #394

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

seonghun-dev
Copy link
Collaborator

@seonghun-dev seonghun-dev commented Oct 30, 2023

    public <T extends ErrorCodeInterface> ExternalServerException(T errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode.toErrorCode();
        this.exception = getException();
    }
  • ErrorDomain Enum을 만들어서, 에러 발생 도메인을 제한하였습니다.
  • Haman Readable 할 수 있는 message 외에도 title을 추가하여, 에러 내용은 title에, 상세내용과 해결방법에 대해서는 message에 작성할 수 있도록 하였습니다.
  • API 서버의 경우 여기서 논의된 에러 처리방법에 따라 변경할 예정입니다.

*
* This interface used to extend errorCodeEnum.
*/
public interface ErrorCodeInterface {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 인터페이스를 확장하여 ErrorEnum을 추가하시면 됩니다.

@seonghun-dev seonghun-dev added ✨feature New feature or request 🧶Notifiction Server Notification Domain labels Oct 30, 2023
@yunyoung1819
Copy link
Collaborator

    public <T extends ErrorCodeInterface> ExternalServerException(T errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode.toErrorCode();
        this.exception = getException();
    }
  • ErrorDomain Enum을 만들어서, 에러 발생 도메인을 제한하였습니다.
  • Haman Readable 할 수 있는 message 외에도 title을 추가하여, 에러 내용은 title에, 상세내용과 해결방법에 대해서는 message에 작성할 수 있도록 하였습니다.
  • API 서버의 경우 여기서 논의된 에러 처리방법에 따라 변경할 예정입니다.

좋습니다! API 서버의 경우 에러 처리 방법 변경하면서 이참에 로깅 방법에 대해서도 한번 논의해보면 좋을 것 같아요 😄

Copy link
Collaborator

@yunyoung1819 yunyoung1819 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! 에러 코드에 status, domainCode, code, title, message가 들어가면서 이전보다 명확해지고 Conflict가 발생할 여지가 줄은 것 같습니다. 이대로 에러 코드를 관리해도 좋을 것 같아요! 추후에 API 서버에 변경된 에러코드를 적용할 때는 logging도 어떻게 할지 한번 논의해보아도 좋을 것 같습니당 👍

Copy link
Member

@siyeonSon siyeonSon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍

@seonghun-dev seonghun-dev merged commit 272c1d7 into dev Nov 5, 2023
1 check passed
@seonghun-dev seonghun-dev deleted the feat/exception-handling branch November 5, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨feature New feature or request 🧶Notifiction Server Notification Domain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set custom exception in streetdrop-notification module
3 participants