Skip to content

Commit

Permalink
Don’t crash for lack of err.cause
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Mar 14, 2023
1 parent a0ec394 commit 32283b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function msg(err: TeaError): string {
case 'spilt-tea-009':
if (ctx.filename instanceof Path && !ctx.filename.in(usePrefix())) {
// this yaml is being worked on by the user
msg = `${ctx.filename.prettyLocalString()}: ${ctx.cause.message}`
msg = `${ctx.filename.prettyLocalString()}: ${ctx.cause?.message ?? 'unknown cause'}`
} else {
const attachment = `${ctx.project}: ${ctx.cause.message}`
msg = undent`
Expand Down

0 comments on commit 32283b0

Please sign in to comment.