I want to handle NoHandlerException in Springboot app and return a custom error message. I added following to my application.properties and tried to override the error message.
spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=false
Error doesn't hit the @ControllerAdvice... It is handled in defaulthandlerexceptionresolver . Any ideas?
@Order(Ordered.HIGHEST_PRECEDENCE)
on the handler, let me know if this works. – Ultraviolet@Order(Ordered.HIGHEST_PRECEDENCE) @ControllerAdvice
– Ultraviolet