Skip to content

Commit c3e5241

Browse files
committed
Add name to PkgConfigError.couldNotFindConfigFile
1 parent b03fc4f commit c3e5241

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

swift-tools-support-core/Sources/TSCUtility/PkgConfig.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import TSCBasic
1212
import Foundation
1313

1414
public enum PkgConfigError: Swift.Error, CustomStringConvertible {
15-
case couldNotFindConfigFile
15+
case couldNotFindConfigFile(name: String)
1616
case parsingError(String)
1717
case nonWhitelistedFlags(String)
1818

1919
public var description: String {
2020
switch self {
21-
case .couldNotFindConfigFile:
22-
return "couldn't find pc file"
21+
case .couldNotFindConfigFile(let name):
22+
return "couldn't find pc file for \(name)"
2323
case .parsingError(let error):
2424
return "parsing error(s): \(error)"
2525
case .nonWhitelistedFlags(let flags):
@@ -89,7 +89,7 @@ public struct PCFileFinder {
8989
PCFileFinder.shouldEmitPkgConfigPathsDiagnostic = false
9090
diagnostics.emit(warning: "failed to retrieve search paths with pkg-config; maybe pkg-config is not installed")
9191
}
92-
throw PkgConfigError.couldNotFindConfigFile
92+
throw PkgConfigError.couldNotFindConfigFile(name: name)
9393
}
9494
}
9595

@@ -131,7 +131,7 @@ public struct PkgConfig {
131131
) throws {
132132

133133
if let path = try? AbsolutePath(validating: name) {
134-
guard fileSystem.isFile(path) else { throw PkgConfigError.couldNotFindConfigFile }
134+
guard fileSystem.isFile(path) else { throw PkgConfigError.couldNotFindConfigFile(name: name) }
135135
self.name = path.basenameWithoutExt
136136
self.pcFile = path
137137
} else {

0 commit comments

Comments
 (0)