Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mule: getting a hold of the exception message

I have a default catch exception in Mule, and I'm trying to get access to the exception message, using a Mule expression: #[exception]

This doesn't seem to work, and I'm guessing that I'm trying to access the wrong variable? I'm trying to log it using logger and also run a custom component that takes in an exception message (as a string.)

Thanks,

like image 425
Loic Duros Avatar asked Apr 28 '14 14:04

Loic Duros


1 Answers

In some cases the exception.cause could be null, hence advised to use the conditional to display the message:

[(exception.cause!=null)?(exception.cause.message):exception]

This will prevent null pointer exception.

like image 128
Prathiba Avatar answered Sep 20 '22 17:09

Prathiba