0

I have choice exception strategy where I have multiple catch exception strategy there I am applying condition based on the error. Error 1:

org.mule.api.MessagingException: Column 'department_id' cannot be null (java.sql.SQLIntegrityConstraintViolationException).

Error 2:

org.mule.api.MessagingException: org.mule.module.db.internal.domain.connection.ConnectionCreationException: Cannot get connection for URL jdbc:mysql://localhost:3306/mulesoft : Access denied for user 'root1212'@'localhost' (using password: YES) (java.sql.SQLException) (org.mule.module.db.internal.processor.DbConnectionException).

How can I differentiate between both of the error using expression in catch exception strategy?

First catch- Executed when:

[exception.causeMatches("org.mule.api.MessagingException: Column 'department_id' cannot be null*")]

Second catch- Executed when:

[exception.causeMatches("org.mule.api.MessagingException: org.mule.module.db.internal.domain.connection.ConnectionCreationException*")]

By using this not able to trigger into catch exception strategy.

[exception.causeMatches("org.mule.api.MessagingException*")] This is working but for both the error getting same starting string. How can i differentiate both?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.