@@ -583,7 +583,7 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
583
583
if gce .IsGCENotFoundError (err ) {
584
584
return nil , status .Errorf (codes .NotFound , "Could not find instance %v: %v" , nodeID , err .Error ()), diskType
585
585
}
586
- return nil , status . Errorf ( codes . Internal , "Failed to get instance: %v " , err . Error () ), diskType
586
+ return nil , common . LoggedError ( "Failed to get instance: " , err ), diskType
587
587
}
588
588
589
589
readWrite := "READ_WRITE"
@@ -618,12 +618,12 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
618
618
machineType := parseMachineType (instance .MachineType )
619
619
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
620
620
}
621
- return nil , status . Errorf ( codes . Internal , "Failed to Attach: %v " , err . Error () ), diskType
621
+ return nil , common . LoggedError ( "Failed to Attach: " , err ), diskType
622
622
}
623
623
624
624
err = gceCS .CloudProvider .WaitForAttach (ctx , project , volKey , instanceZone , instanceName )
625
625
if err != nil {
626
- return nil , status . Errorf ( codes . Internal , "Errored during WaitForAttach: %v " , err . Error () ), diskType
626
+ return nil , common . LoggedError ( "Errored during WaitForAttach: " , err ), diskType
627
627
}
628
628
629
629
klog .V (4 ).Infof ("ControllerPublishVolume succeeded for disk %v to instance %v" , volKey , nodeID )
@@ -715,7 +715,7 @@ func (gceCS *GCEControllerServer) executeControllerUnpublishVolume(ctx context.C
715
715
klog .Warningf ("Treating volume %v as unpublished because node %v could not be found" , volKey .String (), instanceName )
716
716
return & csi.ControllerUnpublishVolumeResponse {}, nil , diskType
717
717
}
718
- return nil , status . Errorf ( codes . Internal , "error getting instance: %v " , err . Error () ), diskType
718
+ return nil , common . LoggedError ( "error getting instance: " , err ), diskType
719
719
}
720
720
721
721
deviceName , err := common .GetDeviceName (volKey )
@@ -965,7 +965,7 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project
965
965
snapshot , err = gceCS .CloudProvider .GetSnapshot (ctx , project , snapshotName )
966
966
if err != nil {
967
967
if ! gce .IsGCEError (err , "notFound" ) {
968
- return nil , status . Errorf ( codes . Internal , "Failed to get snapshot: %v " , err . Error () )
968
+ return nil , common . LoggedError ( "Failed to get snapshot: " , err )
969
969
}
970
970
// If we could not find the snapshot, we create a new one
971
971
snapshot , err = gceCS .CloudProvider .CreateSnapshot (ctx , project , volKey , snapshotName , snapshotParams )
0 commit comments