Actually, this code looks fine to me.

The status code is simply preserved. I guess at a point where the exception is handled, it is ignored and defaulted to 500.

Sergey
On 17/03/16 03:45, Narsi Nallamilli wrote:
Yes, Brad,

The patch should be while creating the exception,

We should copy the status to the headers so that the header is received with
correct status at the receiving end, which not being done currently and
every exception created out of CxfOperationException is treated as server
exception.

public CxfOperationException(String uri, int statusCode, String statusText,
String location, Map<String, String> responseHeaders,
                                  String responseBody) {
         super("JAXRS operation failed invoking " + uri + " with statusCode:
" + statusCode + (location != null ? ", redirectLocation: " + location
             : ""));
         this.uri = uri;
         this.statusCode = statusCode;
         this.statusText = statusText;
         this.redirectLocation = location;
         this.responseHeaders = responseHeaders;
         this.responseBody = responseBody;
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-CxfRsProducer-not-returning-appropriate-error-status-codes-tp5779161p5779177.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Reply via email to