Skip to content

Commit

Permalink
[#235] feature: missing header exception 발견 후 케이스 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sss4920 committed Mar 31, 2024
1 parent 338a704 commit 302c83f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.web.HttpMediaTypeNotSupportedException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingRequestHeaderException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
Expand Down Expand Up @@ -116,6 +117,14 @@ protected ResponseEntity<ApiResponse> UnknownHostException(final UnknownHostExce
.body(ApiResponse.error(Error.BAD_REQUEST_VALIDATION, Error.BAD_REQUEST_VALIDATION.getMessage()));
}

@ResponseStatus(HttpStatus.BAD_REQUEST)
@ExceptionHandler(MissingRequestHeaderException.class)
protected ResponseEntity<ApiResponse> MissingRequestHeaderException(final MissingRequestHeaderException e){
Sentry.captureException(e);
return ResponseEntity.status(Error.BAD_REQUEST_VALIDATION.getErrorCode())
.body(ApiResponse.error(Error.BAD_REQUEST_VALIDATION, Error.BAD_REQUEST_VALIDATION.getMessage()));
}



/**
Expand Down

0 comments on commit 302c83f

Please sign in to comment.