bitpay / node-bitpay-client

A Node.js module and command line client for interacting with BitPay's Cryptographically Secure API
102 stars 95 forks source link

Add error handling to examples #31

Closed imrehg closed 10 years ago

imrehg commented 10 years ago

The BitPay client library errors are emitted as events back to the caller. If the caller does not receives and acts on them, the outcome is a very uninformative message like this:

TypeError: Uncaught, unspecified "error" event

To prevent this, show the error message to the caller, and hopefully encourage better practice, this patch adds a very simple error handling code to the examples where it would matter.

Signed-off-by: Gergely Imreh imrehg@gmail.com

tacticalchihuahua commented 10 years ago

awesome - thanks!