Skip to content

Commit cea1def

Browse files
committed
re-word to emphasize sendBack's usefulness for errors
1 parent 587dca5 commit cea1def

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/actors.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ Callback actors are a bit different from other actors in that they do not do the
408408
- Do not emit values when used with `.subscribe()`
409409
- Can not be stopped with `.stop()`
410410

411-
Callback functions cannot be `async` functions. But it is possible to execute a Promise within a callback function. Promise rejections will not be caught by `onError`, so you may choose to use `sendBack` to report errors caught from the Promise to the parent actor.
411+
You may choose to use `sendBack` to report caught errors to the parent actor. This is especially helpful for handling promise rejections within a callback function, which will not be caught by [`onError`](invoke.mdx#onerror).
412+
413+
Callback functions cannot be `async` functions. But it is possible to execute a Promise within a callback function.
412414

413415
```ts
414416
const machine = createMachine({

0 commit comments

Comments
 (0)