I would like to do the equivalent of the following C# code:
throw new WebFaultException<string>("The SampleItem returned wasn't
correctly formatted.",
HttpStatusCode.BadRequest);
However, JAX-RS' WebApplicationException requires a Throwable so my code
would look like this:
throw new WebApplicationException(new IllegalArgumentException("The
SampleItem returned wasn't correctly formatted."),
Status.BAD_REQUEST);
It would be nice if JAX-RS supported a similar constructor:
http://msdn.microsoft.com/en-us/library/dd989852.aspx
Thanks,
Ryan