title: Why does this JAVA endpoint not return a detailed error message to the client?
body: <p>I have a server in Java. If I intentionally mispell a word in the sql query so that it is invalid, this function throws an appropriate error. Why does this not pass the detailed error message back to the client? Instead, the extent of the error message only includes</p>
  <blockquote>
  <p>&quot;Request failed with status code 500&quot;</p>
  </blockquote>
  <p>Here is the actual detailed error:</p>
  <blockquote>
  <p>ERROR: relation &quot;contacs&quot; does not exist</p>
  </blockquote>
  <p>Here is the endpoint...</p>
  <pre><code>@POST
  @Path(&quot;{from_list_id}/{to_list_id}&quot;)
  public Message merge(@PathParam(&quot;from_list_id&quot;) int from_list_id, @PathParam(&quot;to_list_id&quot;) int to_list_id) {
      String sql = &quot;select * from lists where list_id=?&quot;;
  
      sql = &quot;insert into contacts (data, imported, list_id) select data, imported,&quot; + to_list_id
              + &quot; from contacs where list_id = &quot; + from_list_id;
      int rowsAffected = db.sql(sql).execute().getRowsAffected();
      return Message.success(
              &quot;Successfully merged &quot; + rowsAffected + &quot; contacts&quot;);
  }
  </code></pre>
  <p>I see that dropwizard captures the exact error in my log file but this error does not get sent to the client. Our client is a Vuejs component that uses axios.</p>
  <p>Here is the client axios call</p>
  <pre><code> this.$axios
      .post(&quot;/merge/&quot; + this.from_list_id + &quot;/&quot; + this.to_list_id, {
        timeout: 0
      })
      .then(
        response =&gt; {
          this.list = response;
          util.showSuccess(response.data.message);
        },
        error =&gt; {
          console.log(JSON.stringify(error));
          util.showError(error);
        }
      );
  </code></pre>