I see that when something goes wrong in a service call I can write code
something like:
throw new WebApplicationException(
        Response
          .status(Status.BAD_REQUEST)
          .entity("Couldn't parse date: " + dateAsString + " (" +
e.getMessage() + ")")
          .build()
      );
I’m a bit unclear on what “entity” means in this case.  Is there a way
to populate specific header fields?  I would like a “message” header
entry along with a “detail”.  For example, I want error messages to
show in the “message” header, stack dumps in “detail”….
Thanks for any thoughts….