diff --git a/src/hooks/useErrorHandler.ts b/src/hooks/useErrorHandler.ts index a754a1f4..9db572ff 100644 --- a/src/hooks/useErrorHandler.ts +++ b/src/hooks/useErrorHandler.ts @@ -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`