From 670db218f1bbd54f94e42ca2989b2112115a2b22 Mon Sep 17 00:00:00 2001 From: Maggie Lou Date: Thu, 19 Dec 2024 16:00:10 -0600 Subject: [PATCH] [RB] Fix error handling --- cli/remotebazel/remotebazel.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/remotebazel/remotebazel.go b/cli/remotebazel/remotebazel.go index 2749a0002cc..53d486efe3f 100644 --- a/cli/remotebazel/remotebazel.go +++ b/cli/remotebazel/remotebazel.go @@ -940,7 +940,11 @@ func Run(ctx context.Context, opts RunOpts, repoConfig *RepoConfig) (int, error) } rsp, err := rexec.Wait(rexec.NewRetryingStream(ctx, execClient, waitExecutionStream, executionID)) if err != nil { - return fmt.Errorf("wait execution: %w", err) + return fmt.Errorf("wait execution: %v", err) + } else if rsp.Err != nil { + return fmt.Errorf("wait execution: %v", rsp.Err) + } else if rsp.ExecuteResponse.GetResult() == nil { + return fmt.Errorf("empty execute response from WaitExecution: %v", rsp.ExecuteResponse.GetStatus()) } executeResponse = rsp.ExecuteResponse return nil