Skip to content

Commit

Permalink
Better error check
Browse files Browse the repository at this point in the history
  • Loading branch information
gabegorelick committed Oct 3, 2017
1 parent f8f4a01 commit 3f7ccf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/util.js
Expand Up @@ -234,10 +234,11 @@ function safeToString(obj) {
}

function isError(obj) {
return obj !== null &&
return obj instanceof Error ||
(obj !== null &&
typeof obj === "object" &&
typeof obj.message === "string" &&
typeof obj.name === "string";
typeof obj.name === "string");
}

function markAsOriginatingFromRejection(e) {
Expand Down

0 comments on commit 3f7ccf4

Please sign in to comment.