From ca4fc1c2c84376a34346abda96f08aba4831f809 Mon Sep 17 00:00:00 2001 From: Yifan Gu Date: Tue, 19 Jan 2021 00:09:31 -0500 Subject: [PATCH] write error to stderr when VM fails to start --- vmcli/main.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmcli/main.swift b/vmcli/main.swift index 183880f..0e6b9ea 100644 --- a/vmcli/main.swift +++ b/vmcli/main.swift @@ -265,7 +265,9 @@ Omit mac address for a generated address. switch result { case .success: return - case .failure: + case .failure(let error): + FileHandle.standardError.write(error.localizedDescription.data(using: .utf8)!) + FileHandle.standardError.write("\n".data(using: .utf8)!) quit(1) } })