diff --git a/Sources/Subprocess/Platforms/Subprocess+Darwin.swift b/Sources/Subprocess/Platforms/Subprocess+Darwin.swift index 95645bc..5182ee5 100644 --- a/Sources/Subprocess/Platforms/Subprocess+Darwin.swift +++ b/Sources/Subprocess/Platforms/Subprocess+Darwin.swift @@ -393,8 +393,8 @@ extension Configuration { ) } else { error = SubprocessError( - code: .init(.spawnFailed), - underlyingError: .init(rawValue: spawnAttributeError) + code: .init(.failedToChangeWorkingDirectory(self.workingDirectory?.string ?? "unknown")), + underlyingError: .init(rawValue: chdirError) ) } throw error