From d4f9b41eda4ab1694779f2ace11ab4cea872b2b0 Mon Sep 17 00:00:00 2001 From: Nito Buendia Date: Tue, 11 Sep 2018 23:25:28 +0800 Subject: [PATCH] Print error message when available With the current set up, error message is only printed out when error name is available. There are situations where the ErrorEvent object does not have a `name` property, but the message is still relevant. For more details see #1594 --- src/core/ExceptionFormatter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ExceptionFormatter.js b/src/core/ExceptionFormatter.js index 359a8303..329418ab 100644 --- a/src/core/ExceptionFormatter.js +++ b/src/core/ExceptionFormatter.js @@ -7,6 +7,8 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) { if (error.name && error.message) { message += error.name + ': ' + error.message; + } else if (error.message) { + message += error.message; } else { message += error.toString() + ' thrown'; }