We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b87bd62 + a219c3f commit d257b86Copy full SHA for d257b86
index.js
@@ -132,7 +132,8 @@ function getConstructorName(errorLike) {
132
// If `err` is not an instance of Error it is an error constructor itself or another function.
133
// If we've got a common function we get its name, otherwise we may need to create a new instance
134
// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more.
135
- constructorName = getFunctionName(errorLike) || getFunctionName(new errorLike()); // eslint-disable-line new-cap
+ constructorName = getFunctionName(errorLike).trim() ||
136
+ getFunctionName(new errorLike()); // eslint-disable-line new-cap
137
}
138
139
return constructorName;
0 commit comments