camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <lich...@yahoo.com.INVALID>
Subject OnException - out body length limited by input body length
Date Mon, 25 Sep 2017 12:47:38 GMT
Using an <onException> to handle an exception, I  want to mark the situation as 'handled'
and set the body with information from the exception. Eg:

    <onException>
      <exception>java.lang.Exception</exception>
      <handled>
        <constant>false</constant>
      </handled>
      <setHeader headerName="Exchange.HTTP_RESPONSE_CODE">
        <constant>500</constant>
      </setHeader>
      <setBody>
        <simple>${exception.stacktrace}</simple>
      </setBody>
    </onException>
    
Problem is: the body is only filled up to the existing length of the input body.

For example, if the input body (e.g. of a POST request) is 10 characters, then the output
body is also only 10 characters, filled with a little bit of the stack trace :)
Looks like a bug to me (using 2.18.4), or am I missing a way to properly set the output.

Thanks
- Martin

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message