Wrap error if failed to fetch mon

This will help user to check whats
the actual error. if the config file
is having issue or the  clusterid is
not valid.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2019-08-06 15:24:53 +05:30 committed by mergify[bot]
parent cba6115e30
commit 2ca575b99d
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ func getMonsAndClusterID(options map[string]string) (string, string, error) {
monitors, err := util.Mons(csiConfigFile, clusterID)
if err != nil {
err = fmt.Errorf("failed to fetch monitor list using clusterID (%s)", clusterID)
err = errors.Wrapf(err, "failed to fetch monitor list using clusterID (%s)", clusterID)
return "", "", err
}

View File

@ -372,7 +372,7 @@ func getMonsAndClusterID(options map[string]string) (monitors, clusterID string,
if monitors, err = util.Mons(csiConfigFile, clusterID); err != nil {
klog.Errorf("failed getting mons (%s)", err)
err = fmt.Errorf("failed to fetch monitor list using clusterID (%s)", clusterID)
err = errors.Wrapf(err, "failed to fetch monitor list using clusterID (%s)", clusterID)
return
}