You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2020/04/07 21:17:22 UTC

[royale-asjs] branch develop updated: RoyaleUnit: failure message explicitly includes exception message before stack

This is an automated email from the ASF dual-hosted git repository.

joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 937102f  RoyaleUnit: failure message explicitly includes exception message before stack
937102f is described below

commit 937102f83a1b19dc2f36294515ab717a63ab56e3
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Tue Apr 7 14:17:15 2020 -0700

    RoyaleUnit: failure message explicitly includes exception message before stack
    
    Firefox omits the message, so it is required. some browsers may duplicate it, but it doesn't hurt anything.
---
 .../org/apache/royale/test/listeners/BrowserConsoleListener.as       | 5 +++--
 .../main/royale/org/apache/royale/test/listeners/TraceListener.as    | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/BrowserConsoleListener.as b/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/BrowserConsoleListener.as
index c935437..78536a0 100644
--- a/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/BrowserConsoleListener.as
+++ b/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/BrowserConsoleListener.as
@@ -167,10 +167,11 @@ package org.apache.royale.test.listeners
 		{
 			var message:String = failure.description;
 			var exception:Error = failure.exception;
-			var errorMessage:String = exception.message;
 			if(exception.stack)
 			{
-				message += " " + exception.stack;
+				//message may be duplicated in some browsers, but it needs to be
+				//included because Firefox omits it
+				message += " " + exception.message + "\n" + exception.stack;
 			}
 			else if(exception.message)
 			{
diff --git a/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/TraceListener.as b/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/TraceListener.as
index 9239781..6b7dbf6 100644
--- a/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/TraceListener.as
+++ b/frameworks/projects/RoyaleUnit/src/main/royale/org/apache/royale/test/listeners/TraceListener.as
@@ -166,10 +166,11 @@ package org.apache.royale.test.listeners
 		{
 			var message:String = failure.description;
 			var exception:Error = failure.exception;
-			var errorMessage:String = exception.message;
 			if(exception.stack)
 			{
-				message += " " + exception.stack;
+				//message may be duplicated in some browsers, but it needs to be
+				//included because Firefox omits it
+				message += " " + exception.message + "\n" + exception.stack;
 			}
 			else if(exception.message)
 			{