Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
runat-1128988: More robust error reporting
Browse files Browse the repository at this point in the history
If a promise rejected with null/undefined, then we previously made a bad
thing worse. Now we protect ourselves.

Signed-off-by: Joe Walker <[email protected]>
  • Loading branch information
joewalker committed Feb 5, 2015
1 parent c8ccc9f commit 05b78be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/gcli/testharness/examiner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit 05b78be

@bgrins
Copy link

@bgrins bgrins commented on 05b78be Feb 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.