title: "Executed multiple catch exception strategy "
body: <p>I have choice exception strategy where I have multiple catch exception strategy there I am applying condition based on the error.</p>
  
  <p>Error 1: </p>
  
  <blockquote>
    <p>org.mule.api.MessagingException: Column 'department_id' cannot be null (java.sql.SQLIntegrityConstraintViolationException).</p>
  </blockquote>
  
  <p>Error 2: </p>
  
  <blockquote>
    <p>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).</p>
  </blockquote>
  
  <p>How can I differentiate between both of the error using expression in catch exception strategy?</p>
  
  <p>First catch- Executed when:  </p>
  
  <blockquote>
    <p>[exception.causeMatches("org.mule.api.MessagingException: Column 'department_id' cannot be null*")]</p>
  </blockquote>
  
  <p>Second catch- Executed when:  </p>
  
  <blockquote>
    <p>[exception.causeMatches("org.mule.api.MessagingException: org.mule.module.db.internal.domain.connection.ConnectionCreationException*")]</p>
  </blockquote>
  
  <p>By using this not able to trigger into catch exception strategy. </p>
  
  <blockquote>
    <p>[exception.causeMatches("org.mule.api.MessagingException*")] </p>
  </blockquote>
  
  <p>This is working but for both the error getting same starting string. How can i differentiate both?</p>