Skip to content

Commit

Permalink
Merge pull request #1463 from gabegorelick/isError
Browse files Browse the repository at this point in the history
Better error check
  • Loading branch information
petkaantonov committed Oct 4, 2017
2 parents f8f4a01 + 3f7ccf4 commit 5155a7b
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 5155a7b

Please sign in to comment.