Error
AsyncProcess.swift:40enum Error
enum Error
import Basics
struct AsyncProcessResult
Process result data which is available after process termination.
case illegalUTF8Sequence
The output is not a valid UTF8 sequence.
case nonZeroExit(AsyncProcessResult)
The process had a non zero exit.
case systemError(arguments: [String], underlyingError: Swift.Error)
The process failed with a SystemError
(this is used to still provide context on the process that was launched).
init(arguments: [String], environment: Environment, exitStatus: ExitStatus, output: Result<[UInt8], Swift.Error>, stderrOutput: Result<[UInt8], Swift.Error>)
Create an instance using an exit status and output result.
init(arguments: [String], environment: Environment, exitStatusCode: Int32, normal: Bool, output: Result<[UInt8], Swift.Error>, stderrOutput: Result<[UInt8], Swift.Error>)
Create an instance using a POSIX process exit status code and output result.
let arguments: [String]
The arguments with which the process was launched.
var description: String { get }
let environment: Environment
The environment with which the process was launched.
let exitStatus: ExitStatus
The exit status of the process.
let output: Result<[UInt8], Swift.Error>
The output bytes of the process. Available only if the process was asked to redirect its output and no stdout output closure was set.
let stderrOutput: Result<[UInt8], Swift.Error>
The output bytes of the process. Available only if the process was asked to redirect its output and no stderr output closure was set.
func utf8Output() throws -> String
Converts stdout output bytes to string, assuming they’re UTF8.
func utf8stderrOutput() throws -> String
Converts stderr output bytes to string, assuming they’re UTF8.
enum ExitStatus
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Escapable
protocol Sendable
var description: String { get }
var interpolationDescription: String { get }
var localizedDescription: String { get }
Retrieve the localized description for this error.