Include stack trace in file view error window
Some checks are pending
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions

This commit is contained in:
Misode
2025-01-23 21:42:48 +01:00
parent 8c67166733
commit 3a9f836035

View File

@@ -14,7 +14,11 @@ export function FileView({ docAndNode: original }: FileViewProps) {
const [error, errorRetry] = useErrorBoundary() const [error, errorRetry] = useErrorBoundary()
if (error) { if (error) {
return <ErrorPanel error={`Error viewing the file: ${message(error)}`} onDismiss={errorRetry} /> const viewError = new Error(`Error viewing the file: ${message(error)}`)
if (error.stack) {
viewError.stack = error.stack
}
return <ErrorPanel error={viewError} onDismiss={errorRetry} />
} }
const docAndNode = useDocAndNode(original) const docAndNode = useDocAndNode(original)