print error message if publish does not finish successfully.

This commit is contained in:
Jason Kulatunga
2020-09-20 15:08:58 -06:00
parent ad3f8480d9
commit fd82e9a4da
+1
View File
@@ -137,6 +137,7 @@ func (mc *MetricsCollector) Publish(deviceWWN string, payload []byte) error {
resp, err := httpClient.Post(apiEndpoint.String(), "application/json", bytes.NewBuffer(payload))
if err != nil {
mc.logger.Errorf("An error occurred while publishing SMART data for device (%s): %v", deviceWWN, err)
return err
}
defer resp.Body.Close()