diff --git a/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt b/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt index 84a9653e9..0751ac7dc 100644 --- a/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt +++ b/acceptance/bundle/exec/databricks-cli/target-is-passed/output.txt @@ -13,7 +13,7 @@ >>> errcode [CLI] bundle exec -t pat -- [CLI] current-user me -t oauth Error: cannot resolve bundle auth configuration: validate: more than one authorization method configured: oauth and pat. Config: host=[DATABRICKS_URL], token=***, client_id=client_id, databricks_cli_path=[CLI]. Env: DATABRICKS_HOST, DATABRICKS_TOKEN, DATABRICKS_CLI_PATH -Error: Running "[CLI] current-user me -t oauth" failed with exit code: 1 +Error: running "[CLI] current-user me -t oauth" failed with exit code: 1 Exit code: 1 diff --git a/cmd/bundle/exec.go b/cmd/bundle/exec.go index 2bf925820..bbb8038b9 100644 --- a/cmd/bundle/exec.go +++ b/cmd/bundle/exec.go @@ -13,15 +13,6 @@ import ( "github.com/spf13/cobra" ) -type exitCodeErr struct { - exitCode int - args []string -} - -func (e *exitCodeErr) Error() string { - return fmt.Sprintf("Running %q failed with exit code: %d", strings.Join(e.args, " "), e.exitCode) -} - func newExecCommand() *cobra.Command { execCmd := &cobra.Command{ Use: "exec", @@ -147,10 +138,7 @@ Example usage: // // This keeps the door open for us to associate specific exit codes // with specific classes of errors in the future. - return &exitCodeErr{ - exitCode: exitErr.ExitCode(), - args: args, - } + return fmt.Errorf("running %q failed with exit code: %d", strings.Join(args, " "), exitErr.ExitCode()) } if err != nil { return fmt.Errorf("running %q failed: %w", strings.Join(args, " "), err)