diff --git a/command/monitor/monitor.go b/command/monitor/monitor.go index 655a7d3ddf..a9aa06e09f 100644 --- a/command/monitor/monitor.go +++ b/command/monitor/monitor.go @@ -64,6 +64,10 @@ func (c *cmd) Run(args []string) int { eventDoneCh := make(chan struct{}) if c.logJSON { logCh, err = client.Agent().MonitorJSON(c.logLevel, eventDoneCh, nil) + if err != nil { + c.UI.Error(fmt.Sprintf("Error starting JSON monitor: %s", err)) + return 1 + } } logCh, err = client.Agent().Monitor(c.logLevel, eventDoneCh, nil) if err != nil {