aboutsummaryrefslogtreecommitdiff
path: root/src/server/DashSession.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/DashSession.ts')
-rw-r--r--src/server/DashSession.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server/DashSession.ts b/src/server/DashSession.ts
index a0e00adda..1c70ae1dc 100644
--- a/src/server/DashSession.ts
+++ b/src/server/DashSession.ts
@@ -63,9 +63,12 @@ export class DashSessionAgent extends Session.AppliedSessionAgent {
protected async launchServerWorker() {
const worker = Session.ServerWorker.Create(launchServer); // server initialization delegated to worker
- worker.addExitHandler(() => {
+ worker.addExitHandler(reason => {
const { _socket } = WebSocket;
- _socket && Utils.Emit(_socket, MessageStore.ConnectionTerminated, "Manual");
+ if (_socket) {
+ const message = typeof reason === "boolean" ? (reason ? "exit" : "temporary") : "crash";
+ Utils.Emit(_socket, MessageStore.ConnectionTerminated, message);
+ }
});
return worker;
}