Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MISC: Include React component stack in Recovery Mode report #1750

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
catloversg marked this conversation as resolved.
Show resolved Hide resolved
\`\`\`
${metadata.errorInfo?.componentStack}
\`\`\`

### Save
\`\`\`
Copy your save here if possible
Expand Down