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

chore: provide informational error message when api key env var is not set #84

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

anitarua
Copy link
Collaborator

@anitarua anitarua commented Jan 9, 2024

addresses #77

Before:

Unhandled exception:
API key is an empty string

After:

Unhandled exception:
Environment variable MOMENTO_API_KEY is required and not set

@anitarua anitarua marked this pull request as ready for review January 9, 2024 18:19
@anitarua anitarua marked this pull request as draft January 9, 2024 18:46
@anitarua
Copy link
Collaborator Author

anitarua commented Jan 9, 2024

Converting to draft while I simplify the EnvMomentoTokenProvider class based on Pete's feedback: no longer a subclass of StringMomentoTokenProvider so that super does not get called before the env var is checked, and the named constructors were removed in favor of having just one constructor in each TokenProvider class that accepts optional arguments for overriding the endpoints

@anitarua anitarua marked this pull request as ready for review January 9, 2024 19:59
@anitarua anitarua merged commit 8511f11 into main Jan 9, 2024
2 checks passed
@anitarua anitarua deleted the env-var-error-message branch January 9, 2024 20:05
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.

3 participants