Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #77 from jylauril/prefer-error-name
Browse files Browse the repository at this point in the history
Prefer error.name over error.constructor.name
  • Loading branch information
kattrali authored Jul 8, 2016
2 parents ae74420 + c1b36d5 commit e781e0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function Error(error, errorClass) {
this.errorClass = errorClass || "Error";
} else if (error) {
this.message = error.message;
this.errorClass = errorClass || error.constructor.name || error.name || "Error";
this.errorClass = errorClass || error.name || error.constructor.name || "Error";
} else {
this.message = "[unknown]";
this.errorClass = errorClass || "Error";
Expand Down

0 comments on commit e781e0e

Please sign in to comment.