@@ -245,19 +245,20 @@ func fetchMetadata(client: Client, package: Joined<Package, Repository>) async t
245245 Ingestion . Error. invalidURL ( packageId: package . model. id!, url: package . model. url)
246246 }
247247
248+ // sas 2024-12-13: This should be an `async let` as well but it doesn't compile right now with the
249+ // typed throw. Reported as
250+ // https://github.com/swiftlang/swift/issues/76169
251+ // async let metadata = try await Current.fetchMetadata(client, owner, repository)
252+ let metadata = try await run {
253+ try await Current . fetchMetadata ( client, owner, repository)
254+ } rethrowing: {
255+ Ingestion . Error ( packageId: package . model. id!,
256+ underlyingError: . fetchMetadataFailed( owner: owner, name: repository, details: " \( $0) " ) )
257+ }
248258 async let license = await Current . fetchLicense ( client, owner, repository)
249259 async let readme = await Current . fetchReadme ( client, owner, repository)
250260
251- // First one should be an `async let` as well but it doesn't compile right now. Reported as
252- // https://github.com/swiftlang/swift/issues/76169
253- return ( try await Result { try await Current . fetchMetadata ( client, owner, repository) }
254- . mapError {
255- Ingestion . Error ( packageId: package . model. id!,
256- underlyingError: . fetchMetadataFailed( owner: owner, name: repository, details: " \( $0) " ) )
257- }
258- . get ( ) ,
259- await license,
260- await readme)
261+ return ( metadata, await license, await readme)
261262}
262263
263264
0 commit comments