diff --git a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java
index 849607f86d778a3d406892f1c543a23ba2fbc6d1..d5c157664be398b081f9de196fb94cad78c8e75f 100644
--- a/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java
+++ b/plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java
@@ -225,11 +225,20 @@ public class IDEATestNGRemoteListener {
     if (ex != null) {
       ComparisonFailureData notification;
       try {
-        notification = TestNGExpectedPatterns.createExceptionNotification(failureMessage);
+        notification = ComparisonFailureData.create(ex);
       }
       catch (Throwable e) {
         notification = null;
       }
+
+      if (notification == null) {
+        try {
+          notification = TestNGExpectedPatterns.createExceptionNotification(failureMessage);
+        }
+        catch (Throwable e) {
+          notification = null;
+        }
+      }
       ComparisonFailureData.registerSMAttributes(notification, getTrace(ex), failureMessage, attrs, ex);
     }
     else {