(this is an edit of the original question to make clear that this question is not a duplicate - the question marked as duplicate deals with returning custom error messages in the response, not custom reason phrases to official error codes).
I am trying to return a 'custom reason phrase' for a given Http error code in a restful service (not create a custom code or return custom content in the response), and WebApplicationException(msg, code) is failing at that. I have just found a related post explaining how to create custom Status objects for http responses (JAX/Jersey Custom error code in Response) and will look into it to see if this can be used as a work-around. However, would still like to know if the Jersey folks are working on resolving this issue. I am using version 2.13 of Jersey.
More info on this problem: the HttpServletResponse.sendError(int code, String msg) method does in fact work as expected (when called directly), but it appears to be the case that the 'msg' parameter in the WebApplicationException(msg, code) call gets lost before the HttpServletResponse.sendError method gets called. As a consequence, clients of the service always see the default Http error code reason phrase in the response.