File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
backend/src/main/java/io/f1/backend/global/exception/handler Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 55import io .f1 .backend .global .exception .errorcode .ErrorCode ;
66import io .f1 .backend .global .exception .response .ErrorResponse ;
77
8+ import jakarta .servlet .http .HttpServletRequest ;
89import lombok .extern .slf4j .Slf4j ;
910
1011import org .springframework .http .ResponseEntity ;
@@ -28,8 +29,13 @@ public ResponseEntity<ErrorResponse> handleCustomException(CustomException e) {
2829 }
2930
3031 @ ExceptionHandler (Exception .class )
31- public ResponseEntity <ErrorResponse > handleException (Exception e ) {
32+ public ResponseEntity <ErrorResponse > handleException (Exception e , HttpServletRequest request ) {
3233 log .warn ("handleException: {}" , e .getMessage ());
34+
35+ if ("text/event-stream" .equals (request .getHeader ("Accept" ))) {
36+ return ResponseEntity .noContent ().build ();
37+ }
38+
3339 CommonErrorCode errorCode = CommonErrorCode .INTERNAL_SERVER_ERROR ;
3440
3541 ErrorResponse response = new ErrorResponse (errorCode .getCode (), errorCode .getMessage ());
You can’t perform that action at this time.
0 commit comments