Replies: 1 comment 5 replies
-
The Here is the fixed version: https://codesandbox.io/s/missing-onerror-handler-but-its-really-there-forked-ul2om?file=/src/index.js const parent = Machine({
initial: "a",
states: {
a: {
invoke: {
id: "child",
src: child,
- onError: (_, event) => { ... },
+ onError: {
actions: (_, event) => {
console.log("Received error:", event.data);
}
}
}
}
}
}); |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I found a discussion on this issue already, #1187
But @davidkpiano's last comment doesn't make a ton of sense to me, and there's a really simple repro that is a convention we've been using for a while already.
https://codesandbox.io/s/missing-onerror-handler-but-its-really-there-wn6pc?file=/src/index.js
Can anybody more familiar with this code explain to me why this structure is inadvisable (aside from the obvious fact that it makes xstate barf an error...). I'm trying to escalate the original
new Error("NUH UH")
up to the parent machine so it can reported to the user.I've attempted to do some digging backwards into why this fails but not having much luck as of yet.
Beta Was this translation helpful? Give feedback.
All reactions