Phenomenon:
We encountered some problems using the Apache CXF framework, and generally, if we use the rest client if the return of the processing is correct, then we can easily handle it, but if we return a request return code that is not 200, In this case we found that the exception object does not contain any text in the error message when debugging:
such as this screenshot of the request (we use restclient) test, the return code is 400, the return of the response in the error description field, we want to get the content of this field, but we tried many times, not directly from the exception object to get , which means that none of the similar fields or API methods can be directly obtained.
Our attempt (Debug) screenshot is as follows:
It can be very obvious from here that there is no one field that can directly get the content corresponding to our description text, so our attempt failed.