From 1be52fb3045ae473e9ea48c3f0c38fd1b2c584f1 Mon Sep 17 00:00:00 2001 From: Liz Rice Date: Fri, 23 Jun 2017 09:40:53 +0100 Subject: [PATCH] Add missing error output if JSON output can't be emitted --- cmd/common.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/common.go b/cmd/common.go index 1e35449..33ded89 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -112,6 +112,8 @@ func runChecks(t check.NodeType) { if jsonFmt { out, err := controls.JSON() if err != nil { + fmt.Fprintf(os.Stderr, "failed to output in JSON format: %v\n", err) + os.Exit(1) } fmt.Println(string(out))