If I pass a SpEL expression which is incorrect for the object (e.g. I ask for payload.length on a String payload, instead of asking for payload.length()), then SpEL throws an EvaluationException, which AbstractExpressionEvaluator.evaluateExpression() wraps in MessagingException and re-throws.
As this is likely to always be a bug, I'd prefer that I see some log output, at least at DEBUG log level (e.g. log.debug(e.getMessage()) would suffice within the catch block).
Personally, I'm thinking WARN would be appropriate on a failed expression evaluation.
The alternative AFAIK is that the MessagingException is either going to:
- pass back up the call stack uncaught, so my unit test will see it and fail (for a DirectChannel)
- be logged to an errorChannel if available (for async)
- pass back as far as some other catch, such as in HttpRequestHandlingController, where it get's added to a ModelAndView against errorsKey.
And... yes, I could argue that my test should be asserting that the errorsKey is not present or that there are no messages on the errors channel