From 05b78be9c51ebf4c99d9ea1c63f4b57da3bc532a Mon Sep 17 00:00:00 2001 From: Joe Walker Date: Thu, 5 Feb 2015 16:22:19 +0000 Subject: [PATCH] runat-1128988: More robust error reporting If a promise rejected with null/undefined, then we previously made a bad thing worse. Now we protect ourselves. Signed-off-by: Joe Walker --- lib/gcli/testharness/examiner.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/gcli/testharness/examiner.js b/lib/gcli/testharness/examiner.js index e6d51438..edabd3c6 100644 --- a/lib/gcli/testharness/examiner.js +++ b/lib/gcli/testharness/examiner.js @@ -379,6 +379,14 @@ Test.prototype.run = function(options) { * Object.toString could be a lot better */ function toString(err) { + if (err === null) { + return 'null'; + } + + if (err === undefined) { + return 'undefined'; + } + // Convert err to a string if (typeof err === 'string') { return err;