title: How can i send error text from jersey to js client?
body: <p>In the server side I return this object <code>javax.ws.rs.core.Response</code> to my client.</p>
  
  <pre><code>private Response createStatus500(String error) {
      logger.error(error);
      return Response.status(500).type(error).build();
  }
  </code></pre>
  
  <p>How can i send some text to the client explaining the error.</p>
  
  <p>because now i cannot get this text in the client side:</p>
  
  <pre><code>JSON.stringify(response)
  "{"data":"&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"/&gt;\n&lt;title&gt;Error 500 Internal Server Error&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;&lt;h2&gt;HTTP ERROR 500&lt;/h2&gt;\n&lt;p&gt;Problem accessing /api/VoicesUploader/uploadFiles. Reason:\n&lt;pre&gt;    Internal Server Error&lt;/pre&gt;&lt;/p&gt;&lt;hr&gt;&lt;a href=\"http://eclipse.org/jetty\"&gt;Powered by Jetty:// 9.3.15.v20161220&lt;/a&gt;&lt;hr/&gt;\n\n&lt;/body&gt;\n&lt;/html&gt;\n","status":500,"config":{"method":"POST","transformResponse":[null],"jsonpCallbackParam":"callback","headers":{"Accept":"application/json, text/plain, */*"},"url":"/api/VoicesUploader/uploadFiles","data":{}},"statusText":"Internal Server Error"}"
  </code></pre>