[
https://issues.apache.org/jira/browse/CAMEL-14999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan Bednar resolved CAMEL-14999.
--------------------------------
Regression: (was: Regression)
Resolution: Fixed
Fixed inĀ
[master@ffb362e|https://github.com/apache/camel/commit/ffb362eac47541d2df07247657f8d8de8e8cf591]
(+[master@1ded844|https://github.com/apache/camel/commit/1ded84449802a23ab93b3dfd93812db8b83d6fc0])
> Camel 3 log showCaughtException is not working
> ----------------------------------------------
>
> Key: CAMEL-14999
> URL: https://issues.apache.org/jira/browse/CAMEL-14999
> Project: Camel
> Issue Type: Bug
> Affects Versions: 3.0.0, 3.1.0, 3.2.0
> Reporter: Laurent Chabot
> Assignee: Jan Bednar
> Priority: Minor
> Fix For: 3.3.0
>
>
> Take this simple case:
> {code:java}
> CamelContext ctx = new DefaultCamelContext();
> ctx.addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("direct:input")
> .doTry()
> .throwException(new Exception("Something wrong"))
> .doCatch(Exception.class)
> .end()
> .to("log:error?level=WARN&showCaughtException=true");
> }
> });
> ctx.start();
> ctx.createProducerTemplate().sendBody("direct:input", null);
> {code}
> In Camel 2.x (tested with 2.24.1 and 2.25.1), we get the expected log:
> {noformat}
> 13:58:06,685 | WARN | main | error |
> Exchange[ExchangePattern: InOnly, BodyType: null, Body: [Body is null],
> CaughtExceptionType: java.lang.Exception, CaughtExceptionMessage: Something
> wrong]
> {noformat}
> But in Camel 3.x (tested with 3.0.0, 3.1.0 and 3.2.0), the caught exception
> is not shown:
> {noformat}
> 13:55:19,904 | WARN | main | error |
> Exchange[ExchangePattern: InOnly, BodyType: null, Body: [Body is null]]
> {noformat}
> However, with {{showAll=true}}, the caught exception is correctly shown:
> {noformat}
> 13:58:41,258 | WARN | main | error |
> Exchange[Id: ID-EBEBRPCLDV0019-1588420721258-0-1, ExchangePattern: InOnly,
> Properties: {CamelExceptionCaught=java.lang.Exception: Something wrong,
> CamelToEndpoint=log://error?level=WARN&showAll=true}, Headers: {}, BodyType:
> null, Body: [Body is null], CaughtExceptionType: java.lang.Exception,
> CaughtExceptionMessage: Something wrong, StackTrace: java.lang.Exception:
> Something wrong
> at LogTest$1.configure(LogTest.java:16)
> [...]
> {noformat}
> I went through the different migration guides but couldn't find anything
> about this.
> This is really blocking for our Camel 3.x migration; any workaround is
> welcome! (preferably through endpoint parameters)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)