@@ -136,7 +136,12 @@ public protocol PackageContainer {
136
136
/// client if necessary.
137
137
///
138
138
/// - Precondition: `versions.contains(version)`
139
- func getDependencies( at version: Version ) -> [ PackageContainerConstraint < Identifier > ]
139
+ /// - Throws: If the version could not be resolved; this will abort
140
+ /// dependency resolution completely.
141
+ //
142
+ // FIXME: We should perhaps define some particularly useful error codes
143
+ // here, so the resolver can handle errors more meaningfully.
144
+ func getDependencies( at version: Version ) throws -> [ PackageContainerConstraint < Identifier > ]
140
145
}
141
146
142
147
/// An interface for resolving package containers.
@@ -398,7 +403,10 @@ struct VersionAssignmentSet<C: PackageContainer>: Sequence {
398
403
//
399
404
// FIXME: We should cache this too, possibly at a layer
400
405
// different than above (like the entry record).
401
- for constraint in container. getDependencies ( at: version) {
406
+ //
407
+ // FIXME: Error handling, except that we probably shouldn't have
408
+ // needed to refetch the dependencies at this point.
409
+ for constraint in try ! container. getDependencies ( at: version) {
402
410
let satisfiable = result. merge ( constraint)
403
411
assert ( satisfiable)
404
412
}
@@ -619,7 +627,7 @@ public class DependencyResolver<
619
627
// Get the constraints for this container version and update the
620
628
// assignment to include each one.
621
629
if let result = try merge (
622
- constraints: container. getDependencies ( at: version) ,
630
+ constraints: try container. getDependencies ( at: version) ,
623
631
into: assignment, subjectTo: allConstraints, excluding: allExclusions) {
624
632
// We found a complete valid assignment.
625
633
assert ( result. checkIfValidAndComplete ( ) )
0 commit comments