You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/08-error-handling/2-custom-errors/article.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -185,7 +185,7 @@ try {
185
185
186
186
The new class `PropertyRequiredError` is easy to use: we only need to pass the property name: `newPropertyRequiredError(property)`. The human-readable `message` is generated by the constructor.
187
187
188
-
Please note that `this.name` in `PropertyRequiredError` constructor is again assigned manually. That may become a bit tedius -- to assign `this.name=<classname>` when creating each custom error. But there's a way out. We can make our own "basic error" class that removes this burden from our shoulders by using `this.constructor.name` for `this.name` in the constructor. And then inherit from it.
188
+
Please note that `this.name` in `PropertyRequiredError` constructor is again assigned manually. That may become a bit tedious -- to assign `this.name=<classname>` when creating each custom error. But there's a way out. We can make our own "basic error" class that removes this burden from our shoulders by using `this.constructor.name` for `this.name` in the constructor. And then inherit from it.
0 commit comments