question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`MissingServletRequestPartException` should extend `ServletRequestBindingException` directly

See original GitHub issue

Unlike similar exceptions, MissingServletRequestPartException directly extends ServletException; whereas, the following extend MissingRequestValueException which extends ServletRequestBindingException which indirectly extends ServletException.

  • MissingServletRequestParameterException
  • MissingRequestHeaderException

How about changing it if there is no good reason? 🤔

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rstoyanchevcommented, Jan 17, 2022

I think that would be okay but would probably require some changes in DefaultHandlerExceptionResolver and in ResponseEntityExceptionHandler. Those handle ServletRequestBindingException ahead of MissingServletRequestPartException, while some more concrete sub-classes are checked earlier. We’d probably need to move MissingServletRequestPartException up in the order as well to preserve the call to the protected method.

0reactions
rstoyanchevcommented, Feb 7, 2022

Superseded by #27948.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot @ExceptionHandler for Exception.class not ...
Since I am extending from ResourceEntityExceptionHandler, all the exceptions were being handled by handleException() method in that class.
Read more >
spring-projects/spring-boot - Gitter
I'll make a sample for the Spring Boot team. ... Which exception? ... The request flow should stop after my custom exception, am...
Read more >
Class MissingServletRequestPartException - Spring
Note: This exception does not extend from ServletRequestBindingException because it can also be raised at a lower level, i.e. from this package which...
Read more >
Spring boot Rest responding with empty body for exceptions ...
You need to define generic exception structure once you use @ControllerAdvice. ... when ControllerAdvice class is extending ResponeEntityExceptionHandler .
Read more >
index all classes all packages - spring-web 6.0.2 javadoc
Extension point that subclasses can use to add extra bind values for a request. ... Allows data binding to be disabled directly on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found