Skip to content

Commit

Permalink
feat(logging): extended Exception class
Browse files Browse the repository at this point in the history
  • Loading branch information
kedrzu committed Apr 10, 2024
1 parent 8e09d1f commit b4c4d67
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/logging/src/Exception.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
export type ExceptionOptions = {
cause?: unknown;
[key: string]: unknown;
};

export class Exception extends Error {
constructor(
message: string,
public readonly attrs?: Record<string, unknown>,
public readonly attrs?: ExceptionOptions,
) {
super(message);
super(message, {
cause: attrs?.cause,
});

this.name = 'Exception';
}
}

0 comments on commit b4c4d67

Please sign in to comment.