monitor: fix dropped error (#7206)

This commit is contained in:
Lars Lehtonen 2020-02-11 01:57:50 -08:00 committed by GitHub
parent dda4e9c902
commit 26d706eecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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 {