Skip to content

Commit

Permalink
💪 define name on prototype
Browse files Browse the repository at this point in the history
It is recommended that the `name` property be defined as a string on the
prototype.
  • Loading branch information
Milly committed Jul 29, 2024
1 parent cdaea00 commit f78b966
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
* Batch error raised when one of the functions fails during batch process.
*/
export class BatchError extends Error {
static {
this.prototype.name = "BatchError";
}

/**
* A result list that is successfully completed prior to the error.
*/
Expand All @@ -18,7 +22,6 @@ export class BatchError extends Error {
constructor(message: string, results: unknown[]) {
super(message);

this.name = this.constructor.name;
this.results = results;
}
}

0 comments on commit f78b966

Please sign in to comment.