File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -785,27 +785,25 @@ func deleteAgent(ctx context.Context, cmd *cli.Command) error {
785785 }
786786
787787 var res * lkproto.DeleteAgentResponse
788- var innerErr error
788+ var agentErr error
789789 if err := util .Await (
790790 "Deleting agent [" + util .Accented (agentID )+ "]" ,
791791 func () {
792- if res , innerErr = agentsClient .DeleteAgent (ctx , & lkproto.DeleteAgentRequest {
792+ res , agentErr = agentsClient .DeleteAgent (ctx , & lkproto.DeleteAgentRequest {
793793 AgentId : agentID ,
794- }); err != nil {
795-
796- }
794+ })
797795 },
798796 ); err != nil {
799797 return err
800798 }
801799
802- if innerErr != nil {
803- if twerr , ok := err .(twirp.Error ); ok {
800+ if agentErr != nil {
801+ if twerr , ok := agentErr .(twirp.Error ); ok {
804802 if twerr .Code () == twirp .PermissionDenied {
805803 return fmt .Errorf ("agent hosting is disabled for this project -- join the beta program here [%s]" , cloudAgentsBetaSignupURL )
806804 }
807805 }
808- return err
806+ return agentErr
809807 }
810808
811809 if ! res .Success {
You can’t perform that action at this time.
0 commit comments