@@ -984,11 +984,11 @@ func createDisk(ecsClient cloud.ECSInterface, diskName, snapshotID string, diskV
984984 if errors .Is (err , ErrParameterMismatch ) {
985985 if createDiskRequest .ClientToken == "" {
986986 // protect us from infinite loop
987- return "" , attempt , fmt . Errorf ( "unexpected parameter mismatch" )
987+ return "" , attempt , status . Error ( codes . Internal , "unexpected parameter mismatch" )
988988 }
989989 existingDisk , err := findDiskByName (diskName , ecsClient )
990990 if err != nil {
991- return "" , attempt , fmt .Errorf ("parameter mismatch detected, but fetch existing node failed: %w " , err )
991+ return "" , attempt , status .Errorf (codes . Internal , "parameter mismatch detected, but fetch existing disk failed: %v " , err )
992992 }
993993 if existingDisk == nil {
994994 // No existing disk, retry without client token
@@ -1007,7 +1007,7 @@ func createDisk(ecsClient cloud.ECSInterface, diskName, snapshotID string, diskV
10071007 }
10081008 return diskID , attempt , nil
10091009 }
1010- return "" , createAttempt {}, status .Errorf (codes .Internal , "all attempts failed: %s" , strings .Join (messages , "; " ))
1010+ return "" , createAttempt {}, status .Errorf (codes .InvalidArgument , "all attempts failed: %s" , strings .Join (messages , "; " ))
10111011}
10121012
10131013func buildCreateDiskRequest (diskVol * diskVolumeArgs ) * ecs.CreateDiskRequest {
0 commit comments