@@ -476,7 +476,10 @@ func DeleteAccount(value string) util.CraneCmdError {
476
476
fmt .Printf ("Delete account %s succeeded.\n " , value )
477
477
return util .ErrorSuccess
478
478
} else {
479
- fmt .Printf ("Delete account %s failed: %s.\n " , value , util .ErrMsg (reply .GetReason ()))
479
+ fmt .Printf ("Delete account failed: \n " )
480
+ for _ , errRecode := range reply .ErrRecodeList {
481
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
482
+ }
480
483
return util .ErrorBackend
481
484
}
482
485
}
@@ -508,7 +511,10 @@ func DeleteUser(value string, account string) util.CraneCmdError {
508
511
fmt .Printf ("Remove user %s succeeded.\n " , value )
509
512
return util .ErrorSuccess
510
513
} else {
511
- fmt .Printf ("Remove user %s failed: %s.\n " , value , util .ErrMsg (reply .GetReason ()))
514
+ fmt .Printf ("Remove user failed: \n " )
515
+ for _ , errRecode := range reply .ErrRecodeList {
516
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
517
+ }
512
518
return util .ErrorBackend
513
519
}
514
520
}
@@ -540,7 +546,10 @@ func DeleteQos(value string) util.CraneCmdError {
540
546
fmt .Printf ("Delete QoS %s succeeded.\n " , value )
541
547
return util .ErrorSuccess
542
548
} else {
543
- fmt .Printf ("Delete QoS %s failed: %s.\n " , value , util .ErrMsg (reply .GetReason ()))
549
+ fmt .Printf ("Delete QoS failed: \n " )
550
+ for _ , errRecode := range reply .ErrRecodeList {
551
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
552
+ }
544
553
return util .ErrorBackend
545
554
}
546
555
}
@@ -605,7 +614,10 @@ func ModifyAccount(modifyField protos.ModifyField, newValue string, name string,
605
614
fmt .Println ("Modify information succeeded." )
606
615
return util .ErrorSuccess
607
616
} else {
608
- fmt .Printf ("Modify information failed: %s.\n " , util .ErrMsg (reply .GetReason ()))
617
+ fmt .Printf ("Modify information failed:\n " )
618
+ for _ , errRecode := range reply .ErrRecodeList {
619
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
620
+ }
609
621
return util .ErrorBackend
610
622
}
611
623
}
@@ -663,7 +675,10 @@ func ModifyUser(modifyField protos.ModifyField, newValue string, name string, ac
663
675
fmt .Println ("Modify information succeeded." )
664
676
return util .ErrorSuccess
665
677
} else {
666
- fmt .Printf ("Modify information failed: %s.\n " , util .ErrMsg (reply .GetReason ()))
678
+ fmt .Printf ("Modify information failed: \n " )
679
+ for _ , errRecode := range reply .ErrRecodeList {
680
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
681
+ }
667
682
return util .ErrorBackend
668
683
}
669
684
}
@@ -864,7 +879,9 @@ func BlockAccountOrUser(value string, entityType protos.EntityType, account stri
864
879
fmt .Printf ("Block %s succeeded.\n " , value )
865
880
return util .ErrorSuccess
866
881
} else {
867
- fmt .Println (util .ErrMsg (reply .Reason ))
882
+ for _ , errRecode := range reply .ErrRecodeList {
883
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
884
+ }
868
885
return util .ErrorBackend
869
886
}
870
887
}
@@ -900,7 +917,9 @@ func UnblockAccountOrUser(value string, entityType protos.EntityType, account st
900
917
fmt .Printf ("Unblock %s succeeded.\n " , value )
901
918
return util .ErrorSuccess
902
919
} else {
903
- fmt .Println (util .ErrMsg (reply .Reason ))
920
+ for _ , errRecode := range reply .ErrRecodeList {
921
+ fmt .Printf ("%s: %s \n " , errRecode .ErrValue , util .ErrMsg (errRecode .ErrCode ))
922
+ }
904
923
return util .ErrorBackend
905
924
}
906
925
}
0 commit comments