swiftlang/swift-corelibs-foundation

Foundation.Process on Linux throws error `Error Domain=NSCocoaErrorDomain Code=256 "(null)"` if executable not found

Opened this issue · 1 comments

weissi commented

When creating a Process with executableURL set to a file that doesn't exist, it throws

Error Domain=NSCocoaErrorDomain Code=256 "(null)"

which corresponds to an NSError with domain: NSCocoaErrorDomain (correct) and code: NSFileReadUnknownError (== 256`, incorrect).

Darwin systems have the correct

Error Domain=NSCocoaErrorDomain Code=4 "The file “exist” doesn’t exist." UserInfo={NSFilePath=/dev/null/does/not/exist}

which is code: NSFileNoSuchFileError (== 4).

weissi commented

Apple folk: This is rdar://113899085 .