Thanks Christoph :) I had 2 seconds to hack it up before i boarded a plane. If you run it, exception will bubble up. Was looking for some dialog with dancerjohn about his usecase and how his might be different and where the exception might be caught and/or subsumed.
On Fri, May 24, 2013 at 7:42 AM, Christoph Emmersberger < [email protected]> wrote: > Hi Christian, > > first of all, it would be really helpful if you could provide some more > information. > > Secondly, as far as I can see from the sample code, you are directly > writing to System out "here". However, I do not see any expected behavior > for your RuntimeException. Are you catching this exception somewhere? In > case you do so, please take care about your logging configuration, i.e. > directing your output to the console rather than towards any file, ... > > - Christoph > > On May 24, 2013, at 4:18 PM, Christian Posta wrote: > > > K.. let's start with this, which works... how is your route different? > > > > > https://github.com/christian-posta/camel-sandbox/blob/master/one-off/src/test/java/posta/TestMockExceptions.java > > > > > > > > > > On Fri, May 24, 2013 at 5:45 AM, dancerjohn <[email protected] > >wrote: > > > >> I am attempting to use a MockEndpoint to drive Exception testing. I have > >> configured the MockEndpoint as follows: > >> > >> mockEndpoint.whenAnyExchangeReceived(new Processor(){ > >> > >> public void process(Exchange ago0) throws Exception{ > >> System.out.println("here"); > >> throw new RuntimeException("blah"); > >> } > >> }); > >> > >> When I run my test I see the "here" on the console / log but I don't see > >> any > >> error messages related to the Exception. I believe this route is > currently > >> using the DefaultErrorHandler (bit complicated because the test hits > >> multiple routes in multiple contexts) as I do not have any error > handlers > >> configured. I have some onException logic in place which I am trying to > >> exercise but those are not being hit either. > >> > >> If instead I use adviceWith to throw the same exception at the same > point > >> (intercepting on same URI to which the MockEndpoint is linked) it works > as > >> expected (Exception is thrown and logged by Camel). > >> > >> Why is the Exception not being propagated out of MockEndpoint? > >> > >> > >> > >> -- > >> View this message in context: > >> > http://camel.465427.n5.nabble.com/Using-MockEndpoint-to-throw-an-Exception-not-propated-tp5733088.html > >> Sent from the Camel - Users mailing list archive at Nabble.com. > >> > > > > > > > > -- > > *Christian Posta* > > http://www.christianposta.com/blog > > twitter: @christianposta > > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta
