diff --git a/src/ErrorHandling/DisplayError.ts b/src/ErrorHandling/DisplayError.ts index ec796971c..78d700b47 100644 --- a/src/ErrorHandling/DisplayError.ts +++ b/src/ErrorHandling/DisplayError.ts @@ -9,7 +9,7 @@ let currentId = 0; export const DisplayError = (message: string, errorType: string, ws: WorkerScript | null = null) => { const scriptName = ws?.scriptRef?.filename ?? ""; const hostname = ws?.hostname ?? ""; - const pid = ws?.pid ?? -1; + const pid = ws?.pid; const parsedMessage = ws ? parseBlobUrlInMessage(ws, message) : message; const errorPageOpen = Router.page() === SimplePage.RecentErrors; if (!errorPageOpen) { @@ -19,7 +19,7 @@ export const DisplayError = (message: string, errorType: string, ws: WorkerScrip if (prior) { prior.occurrences++; prior.time = new Date(); - if (pid !== -1) { + if (pid !== undefined) { prior.pid = pid; } prior.server = hostname; @@ -37,6 +37,7 @@ export const DisplayError = (message: string, errorType: string, ws: WorkerScrip occurrences: 1, time: new Date(), unread: !errorPageOpen, + force: false, }); while (ErrorState.Errors.length > 100) { ErrorState.Errors.pop(); diff --git a/src/ErrorHandling/ErrorModal.tsx b/src/ErrorHandling/ErrorModal.tsx index 89a42ec62..93087f576 100644 --- a/src/ErrorHandling/ErrorModal.tsx +++ b/src/ErrorHandling/ErrorModal.tsx @@ -73,7 +73,7 @@ export function ErrorModal(): React.ReactElement {

Script: {error.scriptName}
- PID: {error.pid} + PID: {String(error.pid)}

{!Settings.SuppressErrorModals && (
- diff --git a/src/ErrorHandling/ErrorState.tsx b/src/ErrorHandling/ErrorState.tsx index 72cce5a01..bf99a6148 100644 --- a/src/ErrorHandling/ErrorState.tsx +++ b/src/ErrorHandling/ErrorState.tsx @@ -6,11 +6,11 @@ export type ErrorRecord = { errorType: string; message: string; scriptName: string; - pid: number; + pid?: number; occurrences: number; time: Date; unread: boolean; - force?: boolean; + force: boolean; }; export const ErrorState = {