fix: MultipartException 전용 핸들러 추가로 불완전한 멀티파트 요청을 400으로 응답#41
Draft
Jeongho0805 wants to merge 1 commit into
Draft
fix: MultipartException 전용 핸들러 추가로 불완전한 멀티파트 요청을 400으로 응답#41Jeongho0805 wants to merge 1 commit into
Jeongho0805 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
GlobalExceptionHandler에MultipartException전용 핸들러 추가Sentry.captureException()호출 없이 400 Bad Request로 응답배경
Sentry 이슈 PRACTICKET-57:
POST /practice/엔드포인트에서MultipartException: Failed to parse multipart servlet request(원인:MalformedStreamException: Stream ended unexpectedly)가 28회 발생, 2명의 사용자에게 영향.클라이언트가 멀티파트 스트림을 전송 도중 연결을 끊거나 불완전한 데이터를 보낼 경우 Spring의
DispatcherServlet.checkMultipart()에서MultipartException이 발생한다. 기존에는 이 예외를 처리하는 전용 핸들러가 없어GlobalExceptionHandler의 catch-allhandle(Exception e)에 걸리면서Sentry.captureException()이 명시 호출되어 서버 오류(500)로 보고되었다. 이는 클라이언트 측 원인에 해당하는 4xx 오류임에도 Sentry에 오탐으로 기록되는 문제다.