aboutsummaryrefslogtreecommitdiff
path: root/src/server/DashSession/Session/agents/server_worker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/DashSession/Session/agents/server_worker.ts')
-rw-r--r--src/server/DashSession/Session/agents/server_worker.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/DashSession/Session/agents/server_worker.ts b/src/server/DashSession/Session/agents/server_worker.ts
index 976d27226..afa5fc68d 100644
--- a/src/server/DashSession/Session/agents/server_worker.ts
+++ b/src/server/DashSession/Session/agents/server_worker.ts
@@ -1,6 +1,6 @@
import { ExitHandler } from "./applied_session_agent";
import { isMaster } from "cluster";
-import { manage } from "./promisified_ipc_manager";
+import { manage, ErrorLike } from "./promisified_ipc_manager";
import IPCMessageReceiver from "./process_message_router";
import { red, green, white, yellow } from "colors";
import { get } from "request-promise";
@@ -112,7 +112,9 @@ export class ServerWorker extends IPCMessageReceiver {
private proactiveUnplannedExit = async (error: Error): Promise<void> => {
this.shouldServerBeResponsive = false;
// communicates via IPC to the master thread that it should dispatch a crash notification email
- this.emit(Monitor.IntrinsicEvents.CrashDetected, { error });
+ const { name, message, stack } = error;
+ const deconstructed_error: ErrorLike = { name, message, stack };
+ this.emit(Monitor.IntrinsicEvents.CrashDetected, { error: deconstructed_error });
await this.executeExitHandlers(error);
// notify master thread (which will log update in the console) of crash event via IPC
this.lifecycleNotification(red(`crash event detected @ ${new Date().toUTCString()}`));
@@ -157,4 +159,4 @@ export class ServerWorker extends IPCMessageReceiver {
this.pollServer();
}
-} \ No newline at end of file
+}