Commit ad8b0072720d
tarball2 files changed+4-2
@@ -101,7 +101,7 @@ class WorkerClient {
101101
}102102
return;103103
}104
- if (msg['kind'] === 'fatal') this.handleFatal();104
+ if (msg['kind'] === 'fatal') this.handleFatal(String(msg['message'] ?? ''));105105
else if (msg['kind'] === 'superseded') this.handleSuperseded();106106
else if (msg['kind'] === 'recovered') engineRecovered.update((count) => count + 1);107107
}@@ -119,7 +119,8 @@ class WorkerClient {
119119
}120120
121121
/** The worker crashed and closed every port; every tab respawns it after a beat. */122
- private handleFatal(): void {122
+ private handleFatal(message: string): void {123
+ console.error('The engine panicked and is restarting', message);123124
this.port = null;124125
for (const pending of this.pending.values()) {125126
pending.reject(new ApiError(502, 'the worker stopped; reconnecting'));@@ -106,6 +106,7 @@ function onHostEvent(account: string, eventJson: string): void {
106106
}107107
108108
function onHostFatal(message: string): void {109
+ console.error('engine panicked', message);109110
for (const port of ports) postTo(port, { kind: 'fatal', message });110111
close();111112
}