Skip to content

Commit

Permalink
Ensure no unhandledrejection if canceled (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Oct 28, 2021
1 parent 764f544 commit 20f47f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addon/decorators/stateful-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 20f47f4

Please sign in to comment.