mollie / mollie-api-node

Official Mollie API client for Node
http://www.mollie.com
BSD 3-Clause "New" or "Revised" License
228 stars 62 forks source link

More helpful error in createMollieClient for missing credentials #350

Closed Pimm closed 2 weeks ago

Pimm commented 2 weeks ago

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.