refactor(engine): propagate SyncError through pull task instead of String

PullTask and PullTaskResult now carry Result<SyncPayload, SyncError>
instead of Result<SyncPayload, String>. poll_pull_result pattern-matches
on the error variant to show user-friendly messages:
  Network  → "Can't reach server — check your connection"
  Auth     → "Login expired — tap Sync Now after re-logging in"
  Other    → original error Display

Also removed the stale TODO comment from SyncError in lib.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-04-27 01:05:59 +00:00
parent 45ef3a2058
commit 9a4071c74e
2 changed files with 12 additions and 8 deletions
-2
View File
@@ -7,8 +7,6 @@ use thiserror::Error;
pub enum SyncError {
#[error("unsupported platform for this sync backend")]
UnsupportedPlatform,
// TODO: Replace String with concrete source error types (e.g. reqwest::Error,
// serde_json::Error) when real implementations are added in Phase 8.
#[error("network error: {0}")]
Network(String),
#[error("authentication error: {0}")]