aboutsummaryrefslogtreecommitdiff
path: root/src/server/DashSession/Session/agents/server_worker.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-10-21 10:36:28 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-10-21 10:36:28 +0530
commit5568b31f7a8e83624402838c9f7f71f56defac98 (patch)
tree76a15b61aab3b6554b487eecfe6aac25d6deb151 /src/server/DashSession/Session/agents/server_worker.ts
parentb19a8654bd85a465a4204cfc65da0e753a94f397 (diff)
parent6580a0cbec7321278f8009076e0bb0890d7b3596 (diff)
Merge branch 'restored_server_monitor' of https://github.com/browngraphicslab/Dash-Web into restored_server_monitor
Diffstat (limited to 'src/server/DashSession/Session/agents/server_worker.ts')
-rw-r--r--src/server/DashSession/Session/agents/server_worker.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/server/DashSession/Session/agents/server_worker.ts b/src/server/DashSession/Session/agents/server_worker.ts
index 976d27226..e3ec4e1c6 100644
--- a/src/server/DashSession/Session/agents/server_worker.ts
+++ b/src/server/DashSession/Session/agents/server_worker.ts
@@ -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: DeconstructedError = { 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,10 @@ export class ServerWorker extends IPCMessageReceiver {
this.pollServer();
}
+}
+
+export interface DeconstructedError {
+ name: string;
+ message: string;
+ stack: string | undefined;
} \ No newline at end of file