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

Add some better error messages if no credentials json is found or there's an error loading it. #8

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

ggreer
Copy link
Contributor

@ggreer ggreer commented Mar 12, 2024

No description provided.

@ggreer ggreer requested a review from loganintech March 12, 2024 21:13
var jsonCredentials []byte

if cfg.CredentialsJSONFilePath == "" {
l.Error("no path specified to credentialsJson file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dont we return an error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because one day we'll want to get connector capabilities to work without credentials. For now it just errors trying to create the client.

jsonCredentials, err = os.ReadFile(cfg.CredentialsJSONFilePath) // just pass the file name
if err != nil {
l.Error("error reading credentialsJson file", zap.String("CredentialsJSONFilePath", cfg.CredentialsJSONFilePath), zap.Error(err))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add the .DS_Store to the gitignore so it doesn't get added back accidentally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ggreer ggreer merged commit 5680c21 into main Mar 15, 2024
2 checks passed
@ggreer ggreer deleted the ggreer/credentials-log-error branch March 15, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants