diff --git a/test-app/runtime/src/main/java/com/tns/Runtime.java b/test-app/runtime/src/main/java/com/tns/Runtime.java index 686652b36..ad8caed91 100644 --- a/test-app/runtime/src/main/java/com/tns/Runtime.java +++ b/test-app/runtime/src/main/java/com/tns/Runtime.java @@ -283,11 +283,14 @@ private static String getStackTraceOnly(String content) { } public static String getJSStackTrace(Throwable ex) { - if (ex instanceof NativeScriptException) { - return ((NativeScriptException) ex).getIncomingStackTrace(); - } else { - return null; + Throwable cause = ex; + while(cause != null) { + if(cause instanceof NativeScriptException) { + return ((NativeScriptException) cause).getIncomingStackTrace(); + } + cause = cause.getCause(); } + return null; } public static String getStackTraceErrorMessage(Throwable ex) {