@@ -597,7 +597,7 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
597
597
if gce .IsGCENotFoundError (err ) {
598
598
return nil , status .Errorf (codes .NotFound , "Could not find instance %v: %v" , nodeID , err .Error ()), disk
599
599
}
600
- return nil , status . Errorf ( codes . Internal , "Failed to get instance: %v " , err . Error () ), disk
600
+ return nil , common . LoggedError ( "Failed to get instance: " , err ), disk
601
601
}
602
602
603
603
readWrite := "READ_WRITE"
@@ -632,12 +632,12 @@ func (gceCS *GCEControllerServer) executeControllerPublishVolume(ctx context.Con
632
632
machineType := parseMachineType (instance .MachineType )
633
633
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 ), disk
634
634
}
635
- return nil , status . Errorf ( codes . Internal , "Failed to Attach: %v " , err . Error () ), disk
635
+ return nil , common . LoggedError ( "Failed to Attach: " , err ), disk
636
636
}
637
637
638
638
err = gceCS .CloudProvider .WaitForAttach (ctx , project , volKey , instanceZone , instanceName )
639
639
if err != nil {
640
- return nil , status . Errorf ( codes . Internal , "Errored during WaitForAttach: %v " , err . Error () ), disk
640
+ return nil , common . LoggedError ( "Errored during WaitForAttach: " , err ), disk
641
641
}
642
642
643
643
klog .V (4 ).Infof ("ControllerPublishVolume succeeded for disk %v to instance %v" , volKey , nodeID )
@@ -729,7 +729,7 @@ func (gceCS *GCEControllerServer) executeControllerUnpublishVolume(ctx context.C
729
729
klog .Warningf ("Treating volume %v as unpublished because node %v could not be found" , volKey .String (), instanceName )
730
730
return & csi.ControllerUnpublishVolumeResponse {}, nil , diskToUnpublish
731
731
}
732
- return nil , status . Errorf ( codes . Internal , "error getting instance: %v " , err . Error () ), diskToUnpublish
732
+ return nil , common . LoggedError ( "error getting instance: " , err ), diskToUnpublish
733
733
}
734
734
735
735
deviceName , err := common .GetDeviceName (volKey )
@@ -991,7 +991,7 @@ func (gceCS *GCEControllerServer) createPDSnapshot(ctx context.Context, project
991
991
snapshot , err = gceCS .CloudProvider .GetSnapshot (ctx , project , snapshotName )
992
992
if err != nil {
993
993
if ! gce .IsGCEError (err , "notFound" ) {
994
- return nil , status . Errorf ( codes . Internal , "Failed to get snapshot: %v " , err . Error () )
994
+ return nil , common . LoggedError ( "Failed to get snapshot: " , err )
995
995
}
996
996
// If we could not find the snapshot, we create a new one
997
997
snapshot , err = gceCS .CloudProvider .CreateSnapshot (ctx , project , volKey , snapshotName , snapshotParams )
0 commit comments