Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Jan 7, 2025
1 parent ef8c3f3 commit 0ff447d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/auth_u2m.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ var databricksCliCredentials = U2MCredentials{
// return a special error message for invalid refresh tokens. To help
// users easily reauthenticate, include a command that the user can
// run, prepopulating the profile, host and/or account ID.
if _, ok := err.(*oauth.InvalidRefreshTokenError); ok {
target := &oauth.InvalidRefreshTokenError{}
if errors.As(err, &target) {
return &CliInvalidRefreshTokenError{
loginCommand: buildLoginCommand(ctx, cfg.Profile, arg),
err: err,
Expand Down
3 changes: 2 additions & 1 deletion config/auth_u2m_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
"context"
"errors"
"fmt"
"net/http"
"testing"
"time"
Expand Down Expand Up @@ -126,7 +127,7 @@ func TestU2MCredentials(t *testing.T) {
}

func TestDatabricksCli_ErrorHandler(t *testing.T) {
invalidRefreshTokenError := &oauth.InvalidRefreshTokenError{}
invalidRefreshTokenError := fmt.Errorf("refresh: %w", &oauth.InvalidRefreshTokenError{})
workspaceArg := func() (oauth.OAuthArgument, error) {
return oauth.NewBasicWorkspaceOAuthArgument("https://myworkspace.cloud.databricks.com")
}
Expand Down

0 comments on commit 0ff447d

Please sign in to comment.