I'm using Kotlin and SpringBoot 2.3. While testing I realized that @ExceptionHandler(MissingKotlinParameterException::class) in my controller doesn't work if I have an generic handler for uncaught exceptions with @ExceptionHandler(Exception::class).
The exception always bubbles to generic exception handler. It's not the case with other exceptions like IllegalArgumentsException which the correct handler handles.
Anyone knows what am I missing?
Thanks
Use
@ExceptionHandler(HttpMessageNotReadableException::class)
instead of
@ExceptionHandler(MissingKotlinParameterException::class)
I had the same issue but with this above I solved the problem.
It is something to do with wrapper.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With