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

This commit is contained in:
catloversg 2024-11-05 07:20:02 +07:00 committed by GitHub
parent e5e4e2693f
commit 81e068ba9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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()}`;
@ -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]}
@ -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