title: ResponseBuilder gives 200 OK HTTP response even for server error
body: <p>I am using javax.ws.rs.core.Response api to build and send back response to front end from my spring boot backend. I have a controller as follows.</p>
  
  <pre><code>@GetMapping(value = "/details")
  public Response getDetails() throws ServiceException {
      try {
          //logic to get details
          return Response.status(Response.Status.OK).entity(details).build();
  
      } catch (Exception e) {
          log.error(e.getMessage());
          return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage).build();
      }
  
  }
  </code></pre>
  
  <p>But I am getting 200 OK as the response status for the HTTP Request in the browser/postman even in the case of exceptions. Because of this, the ajax success block executes instead of the error block when there is an exception. Is there any way to make the error block execute in this case? I don't want to throw an exception as it sends the entire stack trace in the response. </p>