camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nav <navde...@yahoo.com>
Subject Error Handling problem while trying to get stack trace
Date Tue, 29 Jun 2010 09:55:15 GMT

HI, 
   We have a requirement that, on error in any of our routes, the error
stack trace should be emailed to the developers. I am using Camel 2.3.0. I
am not able to get the stack trace in the processor. Please let me know what
is the best way to do this . 

   I have the following common error handling route. 

         <handled> 
              <constant>true</constant> 
            </handled> 
            <process ref="errorHandler" /> 
            <convertBodyTo type="java.lang.String"  /> 
           <!--   MAIL COMPONENT HERE  --> 
          </onException> 


In the processor 'errorHandler', I am doing the following: 

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



The result I get instead of the stack trace is : 
[Ljava.lang.StackTraceElement;@4051b1fb 
which is the object representation of the stacktrace element. 

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

Mime
View raw message