Add descriptions for SwiftSyntax errors (#16339)

This commit is contained in:
Harlan
2018-05-03 14:40:14 -04:00
committed by GitHub
parent ebf12c3e66
commit 405e34e91c
2 changed files with 25 additions and 3 deletions

View File

@@ -108,10 +108,18 @@ func findFirstObjectFile(for dsohandle: UnsafeRawPointer = #dsohandle) -> URL? {
return URL(fileURLWithPath: path)
}
enum InvocationError: Error {
enum InvocationError: Error, CustomStringConvertible {
case couldNotFindSwiftc
case couldNotFindSDK
case abort(code: Int)
var description: String {
switch self {
case .couldNotFindSwiftc:
return "could not locate swift compiler binary"
case .couldNotFindSDK:
return "could not locate macOS SDK"
}
}
}
struct SwiftcRunner {