Skip to content

Commit

Permalink
💪 remove unnecessary codes
Browse files Browse the repository at this point in the history
`Error.captureStackTrace()` is v8 method that provide a stack trace for
custom (NOT extends from `Error`) error object. It is not necessary if
the class extends from `Error`.
  • Loading branch information
Milly committed Jul 29, 2024
1 parent d50cc69 commit cdaea00
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ export class BatchError extends Error {
constructor(message: string, results: unknown[]) {
super(message);

if (Error.captureStackTrace) {
Error.captureStackTrace(this, BatchError);
}

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

0 comments on commit cdaea00

Please sign in to comment.