-
Notifications
You must be signed in to change notification settings - Fork 698
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
Enforce presence of application key and secret during initialization #1097
Conversation
Thoughts on making it explicit when the key is not set when it is expected for it to be present so it fail fast?
6fc1254
to
1bc2974
Compare
I support this. |
I ended up with this in my app, not sure if we prefer that: config.api_key = ENV.fetch('SHOPIFY_API_KEY', '').presence || raise("Missing SHOPIFY_API_KEY")
config.secret = ENV.fetch('SHOPIFY_API_SECRET', '').presence || raise("Missing SHOPIFY_API_SECRET") I use
|
I actually like throwing a more specific error if one of the keys isn't present, it can be a bit of a pain point when apps start up without the necessary envs and fail later on for seemingly random reasons. |
@tjoyal I think this may be causing some problems: Shopify/shopify-cli#1006 |
@andyw8 To make sure we are on the same page, I do not think we are challenging here the fact that is raises but rather the low quality error message? Seems like a fair ask. |
@tjoyal The error message is a secondary concern. But I think enforcing that the env vars are always present might have impacted how the generator runs. We're still investigating, no need to take action yet. |
Thoughts on making it explicit when the key is not set when it is expected for it to be present so it fail fast?