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
* refactor: introduce TaskError typed error envelope (#660)
Replace `TaskResult::Error(String)` with `TaskResult::Error(TaskError)`.
TaskError provides typed error propagation with Display for user-facing
messages and Debug for technical details, while From<String> ensures
zero-breakage backwards compatibility with all existing code.
- Create TaskError enum with Generic(String) + #[from] variants for
SpvError, DashPayError, ConfigError, GroveSTARKError, WalletError
- Wire TaskResult::Error(TaskError) through app.rs, connection_status.rs,
and query_dpns_contested_resources.rs
- Change run_backend_task to return Result<_, TaskError>
- app.rs handler now shows Display text in banner + Debug in details
- Document TaskError pattern in CLAUDE.md
- Add manual test scenarios
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: add Other(Box<dyn Error>) variant, dev-only details, transparent errors
- Add Other(Box<dyn Error + Send + Sync>) catch-all variant to TaskError
- Show Debug details in error banner only in developer mode
- Use #[error(transparent)] for proper error chain propagation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: adapt TaskError handler to v1.0-dev MessageBanner API
MessageBanner on v1.0-dev takes &str, not impl Display. Convert
TaskError to string before passing to set_global and with_details.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* remove testing docs, not applicable here
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
**Backend task enums**: `BackendTask` has variants like `IdentityTask(IdentityTask)`, `WalletTask(WalletTask)`, `TokenTask(Box<TokenTask>)`, etc. Each sub-enum has its own variants and corresponding `run_*_task()` method. Results are `BackendTaskSuccessResult` with 50+ typed variants.
124
124
125
+
**Error handling**: Backend tasks return `Result<T, TaskError>` (`src/backend_task/error.rs`). `TaskError` is a typed error envelope — `Display` produces user-friendly text for `MessageBanner`, `Debug` provides technical details for logs. `From<String>` ensures backwards compatibility: existing `Result<T, String>` code works unchanged. Domain errors (`DashPayError`, `SpvError`, etc.) are wired as `#[from]` variants for automatic conversion via `?`. When adding new backend error types, add a `#[from]` variant to `TaskError` rather than converting to `String`.
126
+
125
127
## Screen Pattern
126
128
127
129
All screens implement the `ScreenLike` trait:
@@ -178,7 +180,7 @@ User-facing messages use `MessageBanner` (`src/ui/components/message_banner.rs`)
178
180
179
181
## Database
180
182
181
-
Single SQLite connection wrapped in `Mutex<Connection>`. Schema initialized in `database/initialization.rs`. Domain modules provide typed CRUD methods. Backend task errors are `Result<T, String>` — string errors display directly to users.
183
+
Single SQLite connection wrapped in `Mutex<Connection>`. Schema initialized in `database/initialization.rs`. Domain modules provide typed CRUD methods. Backend task errors use `TaskError` (`src/backend_task/error.rs`) — see App Task System section above.
0 commit comments