Skip to content

Commit bad30fe

Browse files
committed
💪 define name on prototype
It is recommended that the `name` property be defined as a string on the prototype.
1 parent 5c2d445 commit bad30fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

errors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* Batch error raised when one of the functions fails during batch process.
1111
*/
1212
export class BatchError extends Error {
13+
static {
14+
this.prototype.name = "BatchError";
15+
}
16+
1317
/**
1418
* A result list that is successfully completed prior to the error.
1519
*/
@@ -18,7 +22,6 @@ export class BatchError extends Error {
1822
constructor(message: string, results: unknown[]) {
1923
super(message);
2024

21-
this.name = this.constructor.name;
2225
this.results = results;
2326
}
2427
}

0 commit comments

Comments
 (0)