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

Commit

Permalink
Prefer error.name over constructor.name
Browse files Browse the repository at this point in the history
  • Loading branch information
jylauril committed May 19, 2016
1 parent 9506d97 commit c1b36d5
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 c1b36d5

Please sign in to comment.