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

More detailed API key error #921

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tomelm
Copy link
Contributor

@tomelm tomelm commented Jul 25, 2022

Noticed that we were swallowing config errors when returning API keys if something on the config-level was busted. We probably want that for general usage but I made this configurable depending on the log-level.

Copy link

@mnorth-stripe mnorth-stripe left a comment

Choose a reason for hiding this comment

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

Thanks for making our CLI errors more actionable!

I think you could add one more assertion to the test and then it's ready to ship

case "windows":
assert.ErrorContains(t, err, `config.toml: The system cannot find the file specified.`)
default:
assert.ErrorContains(t, err, `config.toml: no such file or directory`)
Copy link

Choose a reason for hiding this comment

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

Sometimes these error messages change or vary (e.g., different linux distros) and I'd like us to have a very obvious and actionable signal if/when that happens, since we're effectively "scraping" a non-guaranteed API.

Can we have an assertion somewhere that alerts us if neither of the two cases we know about today are met?

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.

None yet

3 participants