Bug: throwing an error within onReceive
in invoked callback service isn't being caught by onError
#3279
Labels
Milestone
Description
When throwing an error within
onReceive
in an invoked callback service, it's not caught. Thrown errors outsideonReceive
are caught properly. Therefore I'm forced to do something likecallback({ type: 'ERROR', error })
in order to handle the error properly and transition to an error state in my state machine.Expected result
I expect the error to be caught, so my callback service fails and I can transition to an error state properly.
Actual result
Error is not caught and state machine ends up in an invalid state.
Reproduction
https://codesandbox.io/s/pensive-curran-6p4vvx?file=/src/index.js
Additional context
Checked with @mattpocock on Stately Discord and seems to be a bug.
The text was updated successfully, but these errors were encountered: