diff --git a/addon/decorators/stateful-function.js b/addon/decorators/stateful-function.js index 1751c5b..f31c64c 100644 --- a/addon/decorators/stateful-function.js +++ b/addon/decorators/stateful-function.js @@ -63,6 +63,13 @@ export function statefulFunction(target, _property, descriptor) { handler.isRunning = true; + sp.catch((e) => { + // ensure no unhandledrejection if canceled + if (!(e instanceof CanceledPromise)) { + throw e; + } + }); + return sp; };