camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Orbaan <>
Subject null safe operator on exceptions
Date Fri, 04 Mar 2016 08:14:11 GMT
Hi all,

In the simple language you can use the null safe operator (?.) to avoid null pointer exceptions.
This does not work for the ${exception.stacktrace} like: ${exception?.stacktrace}.

.log(LoggingLevel.WARN, "${exception?.stacktrace}")

2016-03-04 09:04:46,969 [main] org.apache.camel.processor.FatalFallbackErrorHandler - ERROR
- Exception occurred while trying to handle previously thrown exception on exchangeId: ID-PC0480-55853-1457078686408-0-2
using: [Pipeline[[Channel[Log(myRoute)[ggggg]], Channel[Log(myRoute)[exchangeExceptionOgnl(?.stacktrace)]],
Channel[Multicast[[Channel[sendTo(Endpoint[mock://errors])]]]]]]]. The previous and the new
exception will be logged in the following.
2016-03-04 09:04:46,976 [main] org.apache.camel.processor.FatalFallbackErrorHandler - ERROR
- \--> Previous exception on exchangeId: ID-PC0480-55853-1457078686408-0-2
2016-03-04 09:04:46,978 [main] org.apache.camel.processor.FatalFallbackErrorHandler - ERROR
- \--> New exception on exchangeId: ID-PC0480-55853-1457078686408-0-2

Is this something that could/should be fixed or are there reasons why that doesn't work?

With kind regards,

Hans Orbaan

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message