Thanks. Somehow I thought it was a Camel issue but it was not.  This is how
it was fixed. 

public class ErrorHandler implements Processor {
    public void process(Exchange exchange) throws Exception {
       Exception c = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
                          Exception.class);
      exchange.getIn().setBody(getStackTrace(c));
    }


    public static String getStackTrace(Exception ex) {

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    ex.printStackTrace(pw);
    return sw.toString();
  }

}

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Error-Handling-problem-while-trying-to-get-stack-trace-tp511830p511842.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to