Spring Whitelabel error page with custom error message

Viewed 58

I want to display custom error messages and return status codes. I am using:

@ResponseStatus(value= HttpStatus.OK,
        reason="No AuthIds available in queue! Push some AuthIds.")
public class NoAuthIdsAvailableException extends RuntimeException {}

But when navigating to a page that should throw an error, instead of details on the error I get:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Jul 19 16:41:51 EDT 2021
There was an unexpected error (type=OK, status=200).
0 Answers
Related