SPR-14818 - Add exception MissingServletRequestHeaderException#1218
SPR-14818 - Add exception MissingServletRequestHeaderException#1218AustinSong wants to merge 2 commits intospring-projects:masterfrom
Conversation
Add a new exception, MissingServletRequestHeaderException, in the event of a missing required request header. This exception is more consistent with how missing reqest parameters are handled. Issue: SPR-14818
|
Great ! |
|
@mathieuales the PR is still open (and so is the Jira issue). In other words, it's not available yet. |
|
Why is this issue still unresolved? |
|
https://jira.spring.io/browse/SPR-14818 The JIRA ticket seems to be tied to a different pull request, is that intentional? Are we looking to go with a more generic message? |
|
Dear Austin, We are working on identifying redundant development and duplicated pull requests. We have found there is a pull request: #1653 which might be a potentially duplicate to this one. We would really appreciate if you could help us to validate and give us feedback. Thank you very much for your time! Sincerely, |
|
Hey @FancyCoder0 , These pull requests do appear to be duplicates, with some caveats. The other #1653 appears to be more of a generic exception covering several different missing header values. While an improvement, it still leaves ambiguity. This pull request specifically, is only dealing with the case of missing headers. I believe it would be beneficial to include specific exceptions being more explicit for common cases. The fact that it's done for request parameters leads me to also believe this is the favorable approach. Hope this helps! Best, |
|
The referenced Jira issue has been resolved, so this PR looks closable. |
|
Indeed, good catch again @izeye |
Reason : I am implementing a Restful API and needed to add a custom header value to all responses. Some endpoint contained required request headers and wanted to customize the output for the specific situation of missing header values, by handling a more specific exception than ServletRequestBindingException.
General usage benefit: This is more consistent with the implementation of required request parameters. There exists a MissingServletRequestParameterException for the specific situation of missing required request parameters. A more specific exception is beneficial.
Issue: SPR-14818
I have agreed to the ICLA.