On Thu, Jun 18, 2009 at 2:59 PM, Joe Gottman <josephgott...@comcast.net>wrote:

>
>   Suppose I have a route that begins with something like
>
>       from("file://c:\foo\bar")
>
> and I want to catch and handle any Exceptions thrown from this endpoint.
>  Is
> there any way to do this?  I can surround a subsequent "to" in a "doTry"
> ...
> "doCatch" block, but there doesn't seem to be any way to do this for the
> "from" clause.  Am I missing something, or is this a problem with the DSL?


Hi

All the error handling in Camel such as onException, dead letter channel
kicks in when an exchange is created and routed.
So if an exception occurs beforehand such as inside the file consumer (eg a
bug in Camel) then the component itself has a mechanism to handle that.

All consumers (well those that extends DefaultConsumer) have a
fallback ExceptionHandler (org.apache.camel.spi.ExceptionHandler) that
handles all
thrown exception (that gets propagated back). By default its just a logger
handler. But you can configure your own implementation.

There is a setter for this parameter on the Consumer.



B


>
> --
> View this message in context:
> http://www.nabble.com/Catching-errors-from--%22from%22-endpoints-tp24092503p24092503.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to