Reputation: 7501
In Mule, I'm using an until successful around an HTTP endpoint, to catch connection exceptions/timeouts. I'm catching 3 different Java exceptions:
I want to put the catching of these 3 into a failureExpression
in my until-successful
block, however when I try to do something like
#[exception-type:XYZ || exception-type:ZYX]
#[exception-type:XYZ] || #[exception-type:ZYX]
I get an error that it cannot parse these. Is there any way I can specify for the failureExpression
to check for multiple exception types?
Upvotes: 2
Views: 2998
Reputation: 7501
I was able to achieve what I wanted using this:
failureExpression="#[exception != null && (exception.causedBy(java.net.ConnectException) || exception.causedBy(java.net.SocketTimeoutException) || exception.causedBy(java.net.SocketException))]"
My problem was the exception
in the failure expression could be null
, so I had to perform a null check.
Upvotes: 3
Reputation: 33413
This is not correct MEL syntax. It should be something like #[exception is Type1 || exception is Typ2]
.
See:
Upvotes: 1