Skip to content

Commit 3a9f836

Browse files
committed
Include stack trace in file view error window
1 parent 8c67166 commit 3a9f836

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/components/generator/FileView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export function FileView({ docAndNode: original }: FileViewProps) {
1414

1515
const [error, errorRetry] = useErrorBoundary()
1616
if (error) {
17-
return <ErrorPanel error={`Error viewing the file: ${message(error)}`} onDismiss={errorRetry} />
17+
const viewError = new Error(`Error viewing the file: ${message(error)}`)
18+
if (error.stack) {
19+
viewError.stack = error.stack
20+
}
21+
return <ErrorPanel error={viewError} onDismiss={errorRetry} />
1822
}
1923

2024
const docAndNode = useDocAndNode(original)

0 commit comments

Comments
 (0)