Skip to content

Commit dd390a3

Browse files
committed
Improve error messages
1 parent 0a1579d commit dd390a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,21 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
260260
if content.Spec.VolumeSnapshotClassName != nil {
261261
class, err := ctrl.getSnapshotClass(*content.Spec.VolumeSnapshotClassName)
262262
if err != nil {
263-
klog.Errorf("Failed to getSnapshotClass %s", err)
264-
return nil, fmt.Errorf("cannot get snapshot class %s for snapshot content %s", *content.Spec.VolumeSnapshotClassName, err)
263+
klog.Errorf("Failed to get snapshot class %s for snapshot content %s", *content.Spec.VolumeSnapshotClassName, err)
264+
return nil, fmt.Errorf("failed to get snapshot class %s for snapshot content %s", *content.Spec.VolumeSnapshotClassName, err)
265265
}
266266

267267
snapshotterListSecretRef, err := utils.GetSecretReference(utils.SnapshotterListSecretParams, class.Parameters, content.GetObjectMeta().GetName(), nil)
268268
if err != nil {
269-
klog.Errorf("Failed to get secret reference for snapshot %s: %s", content.Name, err.Error())
270-
return nil, fmt.Errorf("cannot get secret reference for snapshot content %#v", content.Name)
269+
klog.Errorf("Failed to get secret reference for snapshot %s: %s", content.Name, err)
270+
return nil, fmt.Errorf("failed to get secret reference for snapshot %s: %s", content.Name, err)
271271
}
272272

273273
snapshotterListCredentials, err = utils.GetCredentials(ctrl.client, snapshotterListSecretRef)
274274
if err != nil {
275275
// Continue with deletion, as the secret may have already been deleted.
276-
klog.Errorf("Failed to get credentials for snapshot %s: %s", content.Name, err.Error())
277-
return nil, fmt.Errorf("cannot get credentials for snapshot content %#v", content.Name)
276+
klog.Errorf("Failed to get credentials for snapshot %s: %s", content.Name, err)
277+
return nil, fmt.Errorf("failed to get credentials for snapshot %s: %s", content.Name, err)
278278
}
279279
}
280280

0 commit comments

Comments
 (0)