diff --git a/readjson.go b/readjson.go index 234bc85..67efefb 100644 --- a/readjson.go +++ b/readjson.go @@ -85,6 +85,9 @@ func readSMARTctlDevices(logger log.Logger) gjson.Result { level.Warn(logger).Log("msg", "S.M.A.R.T. output reading error", "err", err) return gjson.Result{} } + } else if err != nil { + level.Warn(logger).Log("msg", "S.M.A.R.T. output reading error", "err", err) + return gjson.Result{} } return parseJSON(string(out)) }