Improve error message handling with user-friendly messages

- Add ErrorMessageParser in Kotlin and Swift to detect network errors
  and technical messages, replacing them with human-readable text
- Update all ViewModels to use ErrorMessageParser.parse() for error display
- Remove redundant error popup from LoginView (error shows inline only)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-11 20:46:43 -06:00
parent 1839bd0e11
commit 258ccf7354
18 changed files with 201 additions and 66 deletions

View File

@@ -85,7 +85,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.create, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -112,7 +112,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.cancel, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -136,7 +136,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.uncancel, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -160,7 +160,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.markInProgress, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -184,7 +184,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.archive, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -208,7 +208,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.unarchive, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -232,7 +232,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
self.actionState = .error(.update, error.localizedDescription)
self.errorMessage = error.localizedDescription
self.errorMessage = ErrorMessageParser.parse(error.localizedDescription)
completion(false)
}
}
@@ -268,7 +268,7 @@ class TaskViewModel: ObservableObject {
self.isLoadingCompletions = false
}
} catch {
self.completionsError = error.localizedDescription
self.completionsError = ErrorMessageParser.parse(error.localizedDescription)
self.isLoadingCompletions = false
}
}
@@ -360,7 +360,7 @@ class TaskViewModel: ObservableObject {
}
} catch {
await MainActor.run {
self.tasksError = error.localizedDescription
self.tasksError = ErrorMessageParser.parse(error.localizedDescription)
self.isLoadingTasks = false
}
}