Skip to content

Commit 4589dbf

Browse files
fix(overmind): fix error handling on stopDebugOperator
1 parent 367964f commit 4589dbf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

packages/node_modules/overmind/src/operator.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ export function stopDebugOperator(context, value) {
2323
}
2424

2525
if (value instanceof Promise) {
26-
value.then((promiseValue) => {
27-
context.execution.emit(EventType.OPERATOR_END, {
28-
...context.execution,
29-
result: safeValue(promiseValue),
30-
isAsync: true,
26+
value
27+
.then((promiseValue) => {
28+
context.execution.emit(EventType.OPERATOR_END, {
29+
...context.execution,
30+
result: safeValue(promiseValue),
31+
isAsync: true,
32+
})
33+
})
34+
.catch(() => {
35+
// Make sure an error does not cause uncaught
3136
})
32-
})
3337
} else {
3438
context.execution.emit(EventType.OPERATOR_END, {
3539
...context.execution,

0 commit comments

Comments
 (0)