Hey guys. I have a problem with such `RestControll...
# spring
a
Hey guys. I have a problem with such `RestControllerAdvice`:
Copy code
@RestControllerAdvice
class ExceptionHandlingAdvice {

    @ExceptionHandler(NotImplementedError::class)
    fun notImplementedYet(exception: NotImplementedError): ResponseEntity<ErrorResponse> =
        exception.toNotImplementedErrorResponse()

    @ExceptionHandler(Throwable::class)
    fun unexpectedException(exception: Throwable): ResponseEntity<ErrorResponse> =
        exception.toInternalServerErrorResponse()
}
When I call
TODO()
method somewhere in the application the
kotlin.NotImplementedError
is occurred. However, the first hadler does not get it. Does anybody has such a problem?
t
it gets wrapped in a
NestedServletException
in the
DispatcherServlet
a
Will try it. Thanks.
@thanksforallthefish Thanks a lot. You were right.