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

[Feature] - 예외 로깅 시 InternalServerError 는 스택 트레이스도 같이 로깅하도록 변경 #264

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

nak-honest
Copy link
Member

✅ 작업 내용

  • 500 에러 응답 시 스택 트레이스도 출력하도록 변경
  • Swagger 문서에서 프로필 이미지 url 예시 변경

🙈 참고 사항

@nak-honest nak-honest added the BE label Aug 8, 2024
@nak-honest nak-honest added this to the sprint 3 milestone Aug 8, 2024
@nak-honest nak-honest self-assigned this Aug 8, 2024
@nak-honest nak-honest changed the title Feature/be/#258 [Feature] - 예외 로깅 시 InternalServerError 는 스택 트레이스도 같이 로깅하도록 변경 Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Test Results

 27 files   27 suites   5s ⏱️
187 tests 187 ✅ 0 💤 0 ❌
196 runs  196 ✅ 0 💤 0 ❌

Results for commit 6e68ad7.

♻️ This comment has been updated with latest results.

Copy link

@Libienz Libienz left a comment

Choose a reason for hiding this comment

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

👍🏻

Copy link

@hangillee hangillee left a comment

Choose a reason for hiding this comment

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

문제 없어보입니다!

다만, @Schema에 적어두었던 example="S3 이미지 URL"
스웨거 테스트에서 임의의 URL을 적어도 동작하지 않아서 작성해뒀던 것입니다.

현재 작성해주신 URL로 해도 스웨거 테스트 작동하나요?

Copy link

@eunjungL eunjungL left a comment

Choose a reason for hiding this comment

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

예외 메시지 노출은 피해야 할 것 같아서 RC 남겼습니다~!
수고하셨어요 낙낙쓰

public ResponseEntity<ExceptionResponse> handleException(Exception exception) {
log.error("EXCEPTION :: stackTrace = {}", exception.getStackTrace());

ExceptionResponse data = new ExceptionResponse(exception.getMessage());
Copy link

Choose a reason for hiding this comment

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

예상치 못한 예외의 메시지를 클라이언트에게 노출시키는 로직인것 같아요~ 한 번 감싸면 좋을 것 같네용

Copy link
Member Author

Choose a reason for hiding this comment

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

와우 순간 놓쳤네요 바로 수정 들어가~~~

@@ -17,7 +17,7 @@ public record MemberRequest(
@Schema(description = "사용자 닉네임", example = "뚜리")
@NotBlank(message = "닉네임은 비어있을 수 없습니다.")
String nickname,
@Schema(description = "사용자 프로필 사진 URL", example = "S3 이미지 URL")
@Schema(description = "사용자 프로필 사진 URL", example = "https://dev.touroot.kr/profile-image-ex.png")
Copy link

Choose a reason for hiding this comment

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

🙇 🙇

Copy link

@eunjungL eunjungL left a comment

Choose a reason for hiding this comment

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

좋습니다! 굿굿
수고하셨어요 낙낙쓰

@eunjungL eunjungL closed this Aug 8, 2024
@eunjungL eunjungL reopened this Aug 8, 2024
@nak-honest nak-honest merged commit 08e8aa6 into develop/be Aug 8, 2024
4 checks passed
@nak-honest nak-honest deleted the feature/be/#258 branch August 8, 2024 08:03
hangillee pushed a commit to hangillee/2024-touroot that referenced this pull request Aug 20, 2024
…course-teams#264)

* feat: 예외 처리 시 InternalServerError 는 stackTrack를 로깅하는 기능 구현

* feat: Swagger 에서 사용자의 프로필 이미지 url example을 실제 url로 변경

* feat: 서버에서 발생한 에러 메시지를 사용자에게 숨기도록 구현
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature] - 예외 로깅 시 InternalServerError 는 스택 트레이스도 같이 로깅하도록 변경
4 participants