summaryrefslogtreecommitdiff
path: root/Hutch/Views/Repositories/RepositoryListViewModel.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-19 16:59:16 -0500
committerChristian Cleberg <[email protected]>2026-03-19 16:59:16 -0500
commitb82bbeeea48ad27832a355c2a41408559c411104 (patch)
tree0af45101300c75970471573b09f878a1b3763b38 /Hutch/Views/Repositories/RepositoryListViewModel.swift
parent9065ef6e92245a44390e336cc1ae515ae706cdd7 (diff)
downloadhutch-b82bbeeea48ad27832a355c2a41408559c411104.tar.gz
hutch-b82bbeeea48ad27832a355c2a41408559c411104.tar.bz2
hutch-b82bbeeea48ad27832a355c2a41408559c411104.zip
v2.1: bundled polish and fixes
Diffstat (limited to 'Hutch/Views/Repositories/RepositoryListViewModel.swift')
-rw-r--r--Hutch/Views/Repositories/RepositoryListViewModel.swift17
1 files changed, 2 insertions, 15 deletions
diff --git a/Hutch/Views/Repositories/RepositoryListViewModel.swift b/Hutch/Views/Repositories/RepositoryListViewModel.swift
index 5bdc4a5..fd5bafe 100644
--- a/Hutch/Views/Repositories/RepositoryListViewModel.swift
+++ b/Hutch/Views/Repositories/RepositoryListViewModel.swift
@@ -189,7 +189,7 @@ final class RepositoryListViewModel {
} catch {
// Only show error if we have no cached data to fall back on
if repositories.isEmpty {
- self.error = error.localizedDescription
+ self.error = error.userFacingMessage
}
}
@@ -272,20 +272,7 @@ final class RepositoryListViewModel {
}
private func repositoryCreationErrorMessage(for error: Error) -> String {
- let message: String
-
- if let srhtError = error as? SRHTError {
- switch srhtError {
- case .graphQLErrors(let errors):
- message = errors.map(\.message).joined(separator: "\n")
- default:
- message = srhtError.localizedDescription
- }
- } else {
- message = error.localizedDescription
- }
-
- return "Couldn’t create the repository. \(message)"
+ "Couldn’t create the repository. \(error.userFacingMessage)"
}
/// Fetch ALL repositories by paginating through all available pages.