Skip to content

Commit c758966

Browse files
committed
TEMP: include raw HTTP response in invalidResponse error
1 parent 057d0f5 commit c758966

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/PackageRegistry/RegistryManager.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ import struct Foundation.URLQueryItem
2222
import Dispatch
2323

2424
public enum RegistryError: Error {
25+
case unknown
2526
case registryNotConfigured(scope: PackageIdentity.Scope)
2627
case invalidPackage(PackageReference)
2728
case invalidOperation
28-
case invalidResponse
29+
case invalidResponse(HTTPClientResponse)
2930
case invalidURL
3031
case invalidChecksum(expected: String, actual: String)
3132
}
@@ -99,7 +100,7 @@ public final class RegistryManager {
99100
.sorted(by: >)
100101
return versions
101102
} else {
102-
throw RegistryError.invalidResponse
103+
throw RegistryError.invalidResponse(response)
103104
}
104105
})
105106
}
@@ -179,7 +180,7 @@ public final class RegistryManager {
179180
completion: completion
180181
)
181182
} else {
182-
throw RegistryError.invalidResponse
183+
throw RegistryError.unknown
183184
}
184185
} catch {
185186
queue.async {
@@ -262,7 +263,7 @@ public final class RegistryManager {
262263
completion(.failure(error))
263264
}
264265
} else {
265-
completion(.failure(RegistryError.invalidResponse))
266+
completion(.failure(RegistryError.invalidResponse(response)))
266267
}
267268
case .failure(let error):
268269
completion(.failure(error))

0 commit comments

Comments
 (0)