aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/xtext/webSocketMachine.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/xtext/webSocketMachine.ts')
-rw-r--r--subprojects/frontend/src/xtext/webSocketMachine.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/subprojects/frontend/src/xtext/webSocketMachine.ts b/subprojects/frontend/src/xtext/webSocketMachine.ts
index 216ed86a..2fb1f52f 100644
--- a/subprojects/frontend/src/xtext/webSocketMachine.ts
+++ b/subprojects/frontend/src/xtext/webSocketMachine.ts
@@ -1,5 +1,11 @@
1/*
2 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
1import ms from 'ms'; 7import ms from 'ms';
2import { actions, assign, createMachine, RaiseAction } from 'xstate'; 8import { actions, assign, createMachine } from 'xstate';
3 9
4const { raise } = actions; 10const { raise } = actions;
5 11
@@ -217,16 +223,15 @@ export default createMachine(
217 ...context, 223 ...context,
218 errors: [], 224 errors: [],
219 })), 225 })),
220 // Workaround from https://github.com/statelyai/xstate/issues/1414#issuecomment-699972485
221 raiseTimeoutError: raise({ 226 raiseTimeoutError: raise({
222 type: 'ERROR', 227 type: 'ERROR',
223 message: 'Open timeout', 228 message: 'Open timeout',
224 }) as RaiseAction<WebSocketEvent>, 229 }),
225 raisePromiseRejectionError: (_context, { data }) => 230 raisePromiseRejectionError: (_context, { data }) =>
226 raise({ 231 raise<WebSocketContext, WebSocketEvent>({
227 type: 'ERROR', 232 type: 'ERROR',
228 message: data, 233 message: String(data),
229 }) as RaiseAction<WebSocketEvent>, 234 }),
230 }, 235 },
231 }, 236 },
232); 237);