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

fix: use error constructor params and spread them #61

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading