File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,11 @@ public struct ToolsVersionParser {
85
85
throw Error . nonUTF8EncodedManifest ( path: manifestPath)
86
86
}
87
87
88
- return try self . parse ( utf8String: manifestContentsDecodedWithUTF8)
88
+ do {
89
+ return try self . parse ( utf8String: manifestContentsDecodedWithUTF8)
90
+ } catch Error . malformedToolsVersionSpecification( . commentMarker( . isMissing) ) {
91
+ throw UnsupportedToolsVersion ( packageIdentity: . init( path: manifestPath) , currentToolsVersion: . current, packageToolsVersion: . v3)
92
+ }
89
93
}
90
94
91
95
public static func parse( utf8String: String ) throws -> ToolsVersion {
@@ -653,13 +657,8 @@ extension ManifestLoader {
653
657
do {
654
658
regularManifestToolsVersion = try ToolsVersionParser . parse ( manifestPath: regularManifest, fileSystem: fileSystem)
655
659
}
656
- catch {
657
- if case ToolsVersionParser . Error . malformedToolsVersionSpecification( . commentMarker( . isMissing) ) = error {
658
- regularManifestToolsVersion = . v3
659
- }
660
- else {
661
- throw error
662
- }
660
+ catch let error as UnsupportedToolsVersion where error. packageToolsVersion == . v3 {
661
+ regularManifestToolsVersion = . v3
663
662
}
664
663
665
664
// Compare the tools version of this manifest with the regular
You can’t perform that action at this time.
0 commit comments