Commit 300f649e authored by femiadeyemi's avatar femiadeyemi
Browse files

remove whitelabel error and handle error when uri=/tokens

parent 860e127a
......@@ -17,6 +17,12 @@ public class SinglePageApplicationErrorController implements ErrorController
public Object error(HttpServletRequest request, HttpServletResponse response)
{
// FIXME - place the logging code here to log the cause of the error
String uri = (String) request.getAttribute("javax.servlet.error.request_uri");
if (uri.equals("/tokens")) {
return new ResponseEntity<>(
request.getAttribute("javax.servlet.error.message"),
HttpStatus.valueOf((Integer) request.getAttribute("javax.servlet.error.status_code")));
}
if (request.getMethod().equalsIgnoreCase(HttpMethod.GET.name())) {
response.setStatus(HttpStatus.OK.value());
return "forward:/index.html";
......
......@@ -8,6 +8,9 @@ logging:
server:
forward-headers-strategy: NATIVE
error:
whitelabel:
enabled: false
spring:
resources:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment