Skip to content

Commit 5f459b4

Browse files
authored
Merge pull request #2337 from aciidb0mb3r/improve-diags
[Workspace] Turn an IUO into a throwing error
2 parents 30579b1 + 68bd6fd commit 5f459b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Workspace/Workspace.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,9 @@ extension Workspace {
19491949
// annoying. Maybe we should make an SPI on the provider for
19501950
// this?
19511951
let container = try await { containerProvider.getContainer(for: package, skipUpdate: true, completion: $0) } as! RepositoryPackageContainer
1952-
let tag = container.getTag(for: version)!
1952+
guard let tag = container.getTag(for: version) else {
1953+
throw StringError("Internal error: please file a bug at https://bugs.swift.org with this info -- unable to get tag for \(package) \(version); available versions \(container.reversedVersions)")
1954+
}
19531955
let revision = try container.getRevision(forTag: tag)
19541956
checkoutState = CheckoutState(revision: revision, version: version)
19551957

0 commit comments

Comments
 (0)