From cdaea00439f46cf75bff066a2d1c801f1712ae6c Mon Sep 17 00:00:00 2001 From: Milly Date: Tue, 30 Jul 2024 02:45:15 +0900 Subject: [PATCH] :muscle: remove unnecessary codes `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`. --- errors.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/errors.ts b/errors.ts index 987fe26..611cbcf 100644 --- a/errors.ts +++ b/errors.ts @@ -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; }