Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
fix: use error constructor params and spread them (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT authored Oct 13, 2023
1 parent 79b0d01 commit e52fe26
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// get constructor parameters of Error
type ErrorOptions = ConstructorParameters<typeof Error>[1];

export class TsonError extends Error {
constructor(message: string, opts?: ErrorOptions) {
super(message, opts);
constructor(...args: ConstructorParameters<typeof Error>) {
super(...args);
this.name = "TsonError";
}
}
Expand Down

0 comments on commit e52fe26

Please sign in to comment.