diff options
| author | Christian Cleberg <[email protected]> | 2026-07-15 19:26:27 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-15 19:26:27 -0500 |
| commit | 3c99c01ad1c0c855ef1793d4b74a9c77e7445811 (patch) | |
| tree | cc63d6d1c676c6a5ad4051f6f3a05cbe9028c1fb /Hutch | |
| parent | 7ffef07278e94bd3c268ee5cbd5c9c11cbfa3270 (diff) | |
| download | hutch-3c99c01ad1c0c855ef1793d4b74a9c77e7445811.tar.gz hutch-3c99c01ad1c0c855ef1793d4b74a9c77e7445811.tar.bz2 hutch-3c99c01ad1c0c855ef1793d4b74a9c77e7445811.zip | |
fix: stop shadowing serviceNotProvisioned classification
"No such repository or user found" matched the broad "no such" test for
.notFound, which ran first and made the .serviceNotProvisioned rule below it
unreachable. Users hitting a service they have not activated were told the
content was no longer available rather than that the account needs to enable
the service.
Order the specific check ahead of the general one.
Diffstat (limited to 'Hutch')
| -rw-r--r-- | Hutch/Networking/SRHTError.swift | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Hutch/Networking/SRHTError.swift b/Hutch/Networking/SRHTError.swift index e946774..59575c5 100644 --- a/Hutch/Networking/SRHTError.swift +++ b/Hutch/Networking/SRHTError.swift @@ -174,12 +174,14 @@ extension Array where Element == GraphQLError { if containsMessage("unknown revision") || containsMessage("path not in the working tree") { return .unknownRevision } - if containsMessage("not found") || containsMessage("no such") || containsMessage("missing revision") { - return .notFound - } + // Must precede the broader "no such" check below, which would otherwise + // shadow this and report a provisioning failure as missing content. if containsMessage("no such repository or user found") { return .serviceNotProvisioned } + if containsMessage("not found") || containsMessage("no such") || containsMessage("missing revision") { + return .notFound + } if let primaryMessage, !primaryMessage.isEmpty { return .validation } |
