Skip to content

Commit

Permalink
MISC: Include React component stack in Recovery Mode report (#1750)
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg authored Nov 5, 2024
1 parent e5e4e26 commit 81e068b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/ErrorHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function getErrorMetadata(error: unknown, errorInfo?: React.ErrorInfo, pa

export function getErrorForDisplay(error: unknown, errorInfo?: React.ErrorInfo, page?: Page): IErrorData {
const metadata = getErrorMetadata(error, errorInfo, page);
const fileName = (metadata.error as any).fileName;
const fileName = String(metadata.error.fileName);
const features =
`lang=${metadata.features.language} cookiesEnabled=${metadata.features.cookiesEnabled.toString()}` +
` doNotTrack=${metadata.features.doNotTrack ?? "null"} indexedDb=${metadata.features.indexedDb.toString()}`;
Expand All @@ -104,7 +104,7 @@ Please fill this information with details if relevant.
### Environment
* Error: ${metadata.error.toString() ?? "n/a"}
* Error: ${String(metadata.error) ?? "n/a"}
* Page: ${metadata.page ?? "n/a"}
* Version: ${metadata.version.toDisplay()}
* Environment: ${GameEnv[metadata.environment]}
Expand All @@ -118,6 +118,11 @@ Please fill this information with details if relevant.
${metadata.error.stack}
\`\`\`
### React Component Stack
\`\`\`
${metadata.errorInfo?.componentStack}
\`\`\`
### Save
\`\`\`
Copy your save here if possible
Expand Down

0 comments on commit 81e068b

Please sign in to comment.