Skip to content

Commit 08b0ad5

Browse files
committed
Add a log when Swift fails to exit with proper exit code
1 parent 5e85954 commit 08b0ad5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/swift-sh/Helpers/DepsPackage.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ struct DepsPackage {
148148
logger.warning("Got line from unknown fd from swift.", metadata: ["fd": "\(lineWithSource.fd)", "line-or-hex": "\(lineWithSource.strLineOrHex())"])
149149
}
150150
}
151-
} catch ProcessInvocationError.unexpectedSubprocessExit {
151+
} catch ProcessInvocationError.unexpectedSubprocessExit(let terminationStatus, let terminationReason) {
152152
/* Even if we succeed in getting something we deliberately fail as the swift command failed.
153153
* We catch the error because we want to have something less harsh than just
154154
* `Error: unexpectedSubprocessExit(terminationStatus: 1, terminationReason: __C.NSTaskTerminationReason)` in swift-sh output. */
155+
logger.warning("swift invocation for finding REPL args failed with unexpected subprocess exit.", metadata: ["termination_status": "\(terminationStatus)", "termination_reason": "\(terminationReason.rawValue)"])
155156
ret = nil
156157
}
157158
guard var ret else {

0 commit comments

Comments
 (0)