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 helpful error in createMollieClient for missing credentials #350

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

Pimm
Copy link
Collaborator

@Pimm Pimm commented Jul 5, 2024

Previously, not setting apiKey or accessToken to an appropriate value would result in a generic error. After this PR, an accidental empty string (createMollieClient({ apiKey: '' })) gives a distinct error from no value at all (createmollieClient({})).

I suspect this is what happened in #349, and I hope this will prevent some headaches in the future.

Previously, not setting apiKey or accessToken to an appropriate value would result in a generic error. With this change, an accidental empty string gives a distinct error from no value at all.
Copy link
Collaborator

@dsempel dsempel left a comment

Choose a reason for hiding this comment

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

This is a good idea! I added a suggestion.

src/createMollieClient.ts Outdated Show resolved Hide resolved
@Pimm Pimm merged commit e767ac4 into master Jul 5, 2024
5 checks passed
@Pimm Pimm deleted the pimm/better-credential-feedback branch July 5, 2024 14:48
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