mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-21 02:35:28 -04:00
Improve logging of failed commands
This commit is contained in:
parent
649ed12358
commit
02a74e59e3
17 changed files with 44 additions and 36 deletions
Shared
|
@ -27,7 +27,7 @@ class ShellExecutor: NSObject {
|
|||
_ arguments: [String],
|
||||
environment variables: [String: String] = [:],
|
||||
currentDirectoryPath: String? = nil
|
||||
) throws -> (terminationStatus: Int32, standardOutput: String?, standardError: String?) {
|
||||
) throws -> HelperToolCommandResponse {
|
||||
let outputPipe: Pipe = Pipe()
|
||||
let errorPipe: Pipe = Pipe()
|
||||
process = Process()
|
||||
|
@ -56,7 +56,7 @@ class ShellExecutor: NSObject {
|
|||
let errorData: Data = errorPipe.fileHandleForReading.readDataToEndOfFile()
|
||||
let standardError: String? = String(data: errorData, encoding: .utf8)
|
||||
let terminationStatus: Int32 = process.terminationStatus
|
||||
return (terminationStatus: terminationStatus, standardOutput: standardOutput, standardError: (standardError ?? "").isEmpty ? nil : standardError)
|
||||
return HelperToolCommandResponse(terminationStatus: terminationStatus, standardOutput: standardOutput, standardError: standardError)
|
||||
}
|
||||
|
||||
func terminate() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue