Skip to content

Commit

Permalink
Merge pull request #7 from suhdonghwi/master
Browse files Browse the repository at this point in the history
Override `name` field in custom Error classes
  • Loading branch information
alexmojaki authored Oct 2, 2023
2 parents 18165bf + f86bd69 commit 737460d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T = any> {
Expand Down

0 comments on commit 737460d

Please sign in to comment.