diff options
| author | Christian Cleberg <[email protected]> | 2026-04-13 14:20:27 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-13 14:20:27 -0500 |
| commit | 5e63048ab6a741ae947f7fe42efcb5206a3f3963 (patch) | |
| tree | cf8eb2e3bc3b2edb20ef96a2599e684378120e5b /Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift | |
| parent | 0b84ecaf7ba0fb2cd3f3867da8dc732450b55b50 (diff) | |
| download | hutch-5e63048ab6a741ae947f7fe42efcb5206a3f3963.tar.gz hutch-5e63048ab6a741ae947f7fe42efcb5206a3f3963.tar.bz2 hutch-5e63048ab6a741ae947f7fe42efcb5206a3f3963.zip | |
fix: mercurial parity and graphql handlingv3.0.4
- implements consistent UX between repo types
- ensures centralized services and routes are used between repo types
- graphql error handling is centralized
- error messages are consistent
Implements: https://todo.sr.ht/~ccleberg/hutch/58
Implements: https://todo.sr.ht/~ccleberg/hutch/59
Diffstat (limited to 'Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift')
| -rw-r--r-- | Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift b/Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift index 5a0298c..d8303e1 100644 --- a/Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift +++ b/Hutch/Views/Repositories/HgRepositoryDetailViewModel.swift @@ -526,20 +526,9 @@ final class HgRepositoryDetailViewModel { } private func isEmptyRepositoryError(_ error: Error) -> Bool { - if let srhtError = error as? SRHTError, - case .graphQLErrors(let errors) = srhtError { - return errors.contains { - let message = $0.message.localizedLowercase - return message.contains("missing") - || message.contains("not found") - || message.contains("unknown revision") - || message.contains("unknown revision or path not in the working tree") - } - } - - let message = error.localizedDescription.localizedLowercase - return message.contains("missing") - || message.contains("not found") - || message.contains("unknown revision") + error.matchesGraphQLErrorClassification(.notFound) + || error.matchesGraphQLErrorClassification(.unknownRevision) + || error.matchesGraphQLErrorClassification(.noRows) + || error.containsGraphQLErrorMessage("missing") } } |
