You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wang Yan <wy...@gmail.com> on 2019/06/03 15:23:01 UTC
${exception.message} at doCatch Block
Hello All,
As you can see, I am able to getException here in processor , but not able
to get exception message via ${exception.message}
any hints or suggestions are more than welcome !
.doCatch(java.lang.Exception.class)
.process(exchange->{
Throwable ex=exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
Throwable.class);
// able to get exception message
System.out.println("ex-> "+ex.getMessage());
})
// not able to get exception message via ${exception.message}
.setProperty("caughtExceptionMessage",
simple("ValidationErrorInBody: ${exception.message}"))
.throwException(new ValidationException("Validation Error in
body: ${exception.message}"))
.end()
Thanks and Rgds
W.Y