Closed jtcooper10 closed 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
Thanks! Pull request opened here: #180
This is out in 3.2.0
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 inlib/exceptions.js
are actually exposed through thebraintree
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 noinstanceof X
error handling). I can useerrorTypes
for now, but either theexceptions
list should be exposed for exception handling or, if this is intentional, the docs may need to be updated to use theerrorTypes
namespace instead.