You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Global error stream** - `Command.globalErrors` is a `Stream<CommandError>` of all globally-handled errors. Use `registerStreamHandler` in your root widget to show toasts for errors not handled locally:
176
+
```dart
177
+
// In root widget (e.g. MyApp)
178
+
registerStreamHandler(
179
+
target: Command.globalErrors,
180
+
handler: (context, snapshot, cancel) {
181
+
if (snapshot.hasData) showErrorToast(context, snapshot.data!.error);
182
+
},
183
+
);
184
+
```
185
+
175
186
**Listening to errors**:
176
-
`.errors` only emits actual `CommandError` objects - no null check needed. It only emits null if you explicitly call `clearErrors()`.
187
+
`.errors` only emits actual `CommandError` objects - no null check needed. Errors are automatically reset to null on each new `run()` without triggering handlers.
0 commit comments