Skip to content

Commit 27530b1

Browse files
committed
feat: show full error message on fatal error
1 parent b8ac65c commit 27530b1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/cmd/dev_view.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,14 @@ func ViewDiagnosticsPrint(diagnostics []stainless.BuildDiagnostic) string {
373373
sub.WriteString(fmt.Sprintf("%s %s\n", levelIcon, codeStyle.Render(diag.Code)))
374374
sub.WriteString(fmt.Sprintf("%s\n", renderMarkdown(diag.Message)))
375375

376-
sub.WriteString(fmt.Sprintf("%s\n", renderMarkdown(diag.Message)))
376+
if diag.Code == "FatalError" {
377+
switch more := diag.More.AsAny().(type) {
378+
case stainless.BuildDiagnosticMoreMarkdown:
379+
sub.WriteString(fmt.Sprintf("%s\n", renderMarkdown(more.Markdown)))
380+
case stainless.BuildDiagnosticMoreRaw:
381+
sub.WriteString(fmt.Sprintf("%s\n", more.Raw))
382+
}
383+
}
377384

378385
// Show source references if available
379386
if diag.OasRef != "" {

0 commit comments

Comments
 (0)