← ClaudeAtlas

handle-errorslisted

Write a try/catch the house way — which IssueTrackingService method to call (trackIssue / trackHandledError / trackSilentError), the golden rule that every catch tracks or rethrows, the five use-case error patterns, recovery (retry, fallback, state reset), and how to test it. Use when writing any catch block, a store action or use case that calls the API, background work, or platform-channel code.
NarekManukyan/flutter-mobx-kit · ★ 0 · API & Backend · score 70
Install: claude install-skill NarekManukyan/flutter-mobx-kit
# Handle errors Governed by [ADR-0020](../../../docs/adr/0020-error-handling-and-issue-tracking.md). Service: `lib/core/services/issue_tracking_service.dart`. **No service in this repo yet?** Create it before writing the first `catch`. Port the reference implementation and its test from the boilerplate — [`issue_tracking_service.dart`](https://github.com/NarekManukyan/flutter_boilerplate/blob/master/lib/core/services/issue_tracking_service.dart), [`error_notice.dart`](https://github.com/NarekManukyan/flutter_boilerplate/blob/master/lib/core/ui/error_notice.dart), [`issue_tracking_service_test.dart`](https://github.com/NarekManukyan/flutter_boilerplate/blob/master/test/core/services/issue_tracking_service_test.dart) — and adapt three things to the app: how it shows a notice (its navigator / overlay API), its design tokens, and `ignoredStatusCodes` (whatever its interceptors already handle globally). Keep the three method names and the filtering rules. ## The golden rule **Every `catch` in `lib/` either rethrows or tracks through `IssueTrackingService` before it returns.** Track once, in the layer that swallows the error. ## Pick the method by who shows the error ``` Does anything on screen already tell the user this failed? ├─ No, and the user is waiting on it ────────────→ trackIssue (service shows a notice) ├─ Yes: error state, inline message, or the caller │ branches on the null / empty / exception ───────→ trackHandledError (no notice) └─ The user is not