braintree / braintree_node

Braintree Node.js library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
334 stars 104 forks source link

Does not provide an export named 'exceptions' #179

Closed jtcooper10 closed 3 years ago

jtcooper10 commented 3 years ago

General information

Issue description

The Exceptions page of the Braintree docs have a list under the braintree.exceptions namespace for exception handling. However, it doesn't appear that the error classes defined in lib/exceptions.js are actually exposed through the braintree default export.

It does expose braintree.errorTypes, however this appears to just be a dictionary of strings which match up to the type names rather than the exceptions themselves (so no instanceof X error handling). I can use errorTypes for now, but either the exceptions list should be exposed for exception handling or, if this is intentional, the docs may need to be updated to use the errorTypes namespace instead.

crookedneighbor commented 3 years ago

You're totally right that it's missing. Would you like to open a PR? The exceptions file is here: https://github.com/braintree/braintree_node/blob/master/lib/braintree/exceptions.js

jtcooper10 commented 3 years ago

Thanks! Pull request opened here: #180

crookedneighbor commented 3 years ago

This is out in 3.2.0