Skip to content

Commit

Permalink
feat(errors): Added cause to the error print out string
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Dec 23, 2023
1 parent 5205570 commit 2d3e72f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/errors/src/storm-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,14 @@ export class StormError<TCode extends string = string> extends Error {
? `(${this.code})`
: this.code
: EMPTY_STRING
}${this.code || this.name ? ": " : EMPTY_STRING}${this.message}`
}${this.code || this.name ? ": " : EMPTY_STRING}${this.message}${
this.cause
? NEWLINE_STRING +
`Cause: ${
isStormError(this.cause) ? this.cause.print() : this.cause
}`
: EMPTY_STRING
}`
: EMPTY_STRING;
}

Expand Down

0 comments on commit 2d3e72f

Please sign in to comment.