title: CamelHttpResponseCode is null on service error
body: <p>I'm new to camel and writing a small POC to implement in an existing application. Application takes a xml request as input which contains the requested services and relevant data. It then calls those services one by one.
  When a service is called successfully then I retrieve the http response code in a processor like below and do further logic:</p>
  
  <pre><code>Object code = exchange.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE);
      if(null!=code &amp;&amp; code instanceof Integer)
      {
          responseCode = (Integer) code;
      }
  </code></pre>
  
  <p><strong>In success case, responseCode received = 201</strong></p>
  
  <p>Based on the responseCode, I know if the service call is successful and then proceed with the next one.</p>
  
  <p>However, I tried to produce the negative scenario by making the service url incorrect and can't see the http response code anymore:</p>
  
  <p>Original service url - <code>http://xxx:0000/.../.../.../.../...</code></p>
  
  <p>Modified service url - <code>http://xxx:0000/.../.../.../.../abc/...</code></p>
  
  <p><strong>In failure case, responseCode received = null</strong></p>
  
  <p>In postman, I get the below error:</p>
  
  <blockquote>
    <p>org.apache.camel.http.common.HttpOperationFailedException: HTTP
    operation failed invoking <code>http://xxx:0000/.../.../.../.../abc/...</code>
    with statusCode: 404  at
    org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:274)
      at
    org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:183)</p>
  </blockquote>
  
  <p>I don't know why exchange doesn't contain the http response code when it's present in the error message in the postman.</p>
  
  <p>I'm using onException to handle any exceptions and then calling a processor to process the flow further:</p>
  
  <pre><code>&lt;camel:onException&gt;
                  &lt;camel:exception&gt;java.lang.Exception&lt;/camel:exception&gt;
                  &lt;camel:process ref="xxxProcessor" /&gt;
              &lt;/camel:onException&gt;
  </code></pre>
  
  <p>I think I can consider responseCode=null as failure and proceed with my logic but want to understand why response code is being returned as null.</p>
  
  <p>Thanks in advance!</p>