Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error message when no .databrickscfg #1223

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/root/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func AskForWorkspaceProfile(ctx context.Context) (string, error) {
}
switch len(profiles) {
case 0:
return "", fmt.Errorf("%s does not contain workspace profiles; please create one first", path)
return "", fmt.Errorf("%s does not contain workspace profiles; please create one by running 'databricks configure'", path)
case 1:
return profiles[0].Name, nil
}
Expand Down Expand Up @@ -222,7 +222,7 @@ func AskForAccountProfile(ctx context.Context) (string, error) {
}
switch len(profiles) {
case 0:
return "", fmt.Errorf("%s does not contain account profiles; please create one first", path)
return "", fmt.Errorf("%s does not contain account profiles; please create one by running 'databricks configure'", path)
case 1:
return profiles[0].Name, nil
}
Expand Down
2 changes: 1 addition & 1 deletion libs/databrickscfg/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func Get(ctx context.Context) (*config.File, error) {
configFile, err := config.LoadFile(path)
if errors.Is(err, fs.ErrNotExist) {
// downstreams depend on ErrNoConfiguration. TODO: expose this error through SDK
return nil, fmt.Errorf("%w at %s; please create one first", ErrNoConfiguration, path)
return nil, fmt.Errorf("%w at %s; please create one by running 'databricks configure'", ErrNoConfiguration, path)
} else if err != nil {
return nil, err
}
Expand Down
Loading