@@ -515,7 +515,7 @@ public final class ManifestLoader: ManifestLoaderProtocol {
515
515
fileSystem: FileSystem ,
516
516
observabilityScope: ObservabilityScope ,
517
517
completion: @escaping ( Result < ManifestJSONParser . Result , Error > ) -> Void
518
- ) throws {
518
+ ) {
519
519
let cache = self . databaseCacheDir. map { cacheDir -> SQLiteBackedCache < EvaluationResult > in
520
520
let path = Self . manifestCacheDBPath ( cacheDir)
521
521
var configuration = SQLiteBackedCacheConfiguration ( )
@@ -532,14 +532,19 @@ public final class ManifestLoader: ManifestLoaderProtocol {
532
532
// TODO: we could wrap the failure here with diagnostics if it wasn't optional throughout
533
533
defer { try ? cache? . close ( ) }
534
534
535
- let key = try CacheKey (
536
- packageIdentity: packageIdentity,
537
- manifestPath: path,
538
- toolsVersion: toolsVersion,
539
- env: ProcessEnv . vars,
540
- swiftpmVersion: SwiftVersion . currentVersion. displayString,
541
- fileSystem: fileSystem
542
- )
535
+ let key : CacheKey
536
+ do {
537
+ key = try CacheKey (
538
+ packageIdentity: packageIdentity,
539
+ manifestPath: path,
540
+ toolsVersion: toolsVersion,
541
+ env: ProcessEnv . vars,
542
+ swiftpmVersion: SwiftVersion . currentVersion. displayString,
543
+ fileSystem: fileSystem
544
+ )
545
+ } catch {
546
+ return completion ( . failure( error) )
547
+ }
543
548
544
549
do {
545
550
// try to get it from the cache
@@ -556,7 +561,7 @@ public final class ManifestLoader: ManifestLoaderProtocol {
556
561
}
557
562
} catch {
558
563
observabilityScope. emit ( warning: " failed loading cached manifest for ' \( key. packageIdentity) ': \( error) " )
559
- completion ( . failure( error) )
564
+ return completion ( . failure( error) )
560
565
}
561
566
562
567
// shells out and compiles the manifest, finally output a JSON
0 commit comments