mirror of https://github.com/databricks/cli.git
remove error struct
This commit is contained in:
parent
b5e21231eb
commit
39ec48a602
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue