gittip/www.gittip.com — pull request #2483 by seanlinsley (2014-06-10 02:35:40+00:00)
Title: Fix Balanced JS error messages

When testing #2482 I noticed that the default CC form was raising an exception when I didn't manually provide the country. That's a problem, since it means that anyone who's tried adding a CC (and presumably a bank account) since #2448 (?) has had the form silently fail since they likely didn't choose their country.

It turns out that Balanced API version 1.1 has changed the structure of the error messages. Where before we expected `response.error.description`, now we're told to expect responses like this: ([docs](https://docs.balancedpayments.com/1.1/guides/balanced-js/))

![screen shot 2014-06-09 at 9 30 00 pm](https://cloud.githubusercontent.com/assets/688886/3225065/39bbcc76-f047-11e3-93da-ad57a6609c2f.png)

To clarify, the JS error where the code actually failed was: `TypeError: response.status is undefined`

I'm not happy with this solution though, because it gives a rather obtuse error message:

![screen shot 2014-06-09 at 9 17 21 pm](https://cloud.githubusercontent.com/assets/688886/3225080/7c53a45a-f047-11e3-9eb4-cda770ab3dda.png)

While we can of course default the country to the United States, is there a plan to provide more concise error messages @mjallday / @msherry?