remove error struct

This commit is contained in:
Shreyas Goenka 2025-03-05 10:58:18 +01:00
parent b5e21231eb
commit 39ec48a602
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 2 additions and 14 deletions

View File

@ -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

View File

@ -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)