I am using Spring Boot 2.1.4.RELEASE with Angular 2. Currently I keep my Angular code in /static directory. This is deployed in an external (not embedded) tomcat 9.
Default Spring boot error controller returns WhiteLabel html error page response if the request comes from the browser and json error response if the request is a rest request.
How can I override default whitelabel error page with custom html error page if the request comes from a browser but still get the json error response if the request is a rest request ?