@@ -590,7 +590,7 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
590
590
if gce .IsGCENotFoundError (err ) {
591
591
return nil , status .Errorf (codes .NotFound , "Could not find instance %v: %v" , nodeID , err .Error ()), diskType
592
592
}
593
- return nil , status . Errorf ( codes . Internal , "Failed to get instance: %v " , err . Error () ), diskType
593
+ return nil , common . LoggedError ( "Failed to get instance: " , err ), diskType
594
594
}
595
595
596
596
readWrite := "READ_WRITE"
@@ -625,12 +625,12 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
625
625
machineType := parseMachineType (instance .MachineType )
626
626
return nil , status .Errorf (codes .InvalidArgument , "'%s' is not a compatible disk type with the machine type %s, please review the GCP online documentation for available persistent disk options" , udErr .DiskType , machineType ), diskType
627
627
}
628
- return nil , status . Errorf ( codes . Internal , "Failed to Attach: %v " , err . Error () ), diskType
628
+ return nil , common . LoggedError ( "Failed to Attach: " , err ), diskType
629
629
}
630
630
631
631
err = gceCS .CloudProvider .WaitForAttach (ctx , project , volKey , instanceZone , instanceName )
632
632
if err != nil {
633
- return nil , status . Errorf ( codes . Internal , "Errored during WaitForAttach: %v " , err . Error () ), diskType
633
+ return nil , common . LoggedError ( "Errored during WaitForAttach: " , err ), diskType
634
634
}
635
635
636
636
klog .V (4 ).Infof ("ControllerPublishVolume succeeded for disk %v to instance %v" , volKey , nodeID )
@@ -722,7 +722,7 @@ func (gceCS *GCEControllerServer) executeControllerUnpublishVolume(ctx context.C
722
722
klog .Warningf ("Treating volume %v as unpublished because node %v could not be found" , volKey .String (), instanceName )
723
723
return & csi.ControllerUnpublishVolumeResponse {}, nil , diskType
724
724
}
725
- return nil , status . Errorf ( codes . Internal , "error getting instance: %v " , err . Error () ), diskType
725
+ return nil , common . LoggedError ( "error getting instance: " , err ), diskType
726
726
}
727
727
728
728
deviceName , err := common .GetDeviceName (volKey )
@@ -972,7 +972,7 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project
972
972
snapshot , err = gceCS .CloudProvider .GetSnapshot (ctx , project , snapshotName )
973
973
if err != nil {
974
974
if ! gce .IsGCEError (err , "notFound" ) {
975
- return nil , status . Errorf ( codes . Internal , "Failed to get snapshot: %v " , err . Error () )
975
+ return nil , common . LoggedError ( "Failed to get snapshot: " , err )
976
976
}
977
977
// If we could not find the snapshot, we create a new one
978
978
snapshot , err = gceCS .CloudProvider .CreateSnapshot (ctx , project , volKey , snapshotName , snapshotParams )
0 commit comments