Skip to content

Commit

Permalink
fix(midnight-smoker): fix missing 'cause' prop on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Oct 11, 2023
1 parent 8e57f47 commit dc3ac8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/midnight-smoker/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export abstract class SmokerError<Cause extends object | void = void>
public readonly cause?: Cause;

constructor(message: string, opts?: SmokerErrorOpts<Cause>) {
super(message, opts);
super(message);
// XXX I guess Node's `Error` constructor is broken, since it should accept
// a second parameter `ErrorOptions` having a `cause` prop??
this.cause = opts?.cause;
this.code = opts?.code;
}

Expand Down

0 comments on commit dc3ac8f

Please sign in to comment.