print error message if publish does not finish successfully.

pull/38/head
Jason Kulatunga 4 years ago
parent ad3f8480d9
commit fd82e9a4da

@ -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()

Loading…
Cancel
Save