From f86bd6962030dbc805551aef51154536fcf86974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EB=8F=99=ED=9C=98?= Date: Mon, 2 Oct 2023 18:50:04 +0900 Subject: [PATCH] override `name` field in custom Error classes --- lib/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/index.ts b/lib/index.ts index 1591a4e..fc541a9 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -4,11 +4,13 @@ import * as Comlink from "comlink"; export class InterruptError extends Error { // To avoid having to use instanceof public readonly type = "InterruptError"; + public readonly name = this.type; } export class NoChannelError extends Error { // To avoid having to use instanceof public readonly type = "NoChannelError"; + public readonly name = this.type; } export class SyncClient {