docs(coding-agent): update event bus docs - async errors now caught automatically

This commit is contained in:
Mario Zechner 2026-01-04 21:37:16 +01:00
parent 9c9e6822e3
commit 99a539baa4
2 changed files with 2 additions and 22 deletions

View file

@ -202,17 +202,7 @@ const unsubscribe = pi.events.on("other:event", (data) => {
Events are session-scoped. Use namespaced channel names like `"toolname:event"` to avoid collisions.
Handler errors are caught and logged. For async handlers, handle errors internally:
```typescript
pi.events.on("mytool:event", async (data) => {
try {
await doSomething(data);
} catch (err) {
console.error("Handler failed:", err);
}
});
```
Handler errors (sync and async) are caught and logged.
### Sending Messages