Skip to content

Commit 6dde86f

Browse files
committed
Merge pull request #23 from unformatt/patch-1
API error in create_button was not printing
2 parents 7cf13bc + 2e29d4f commit 6dde86f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

coinbase/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,7 @@ def create_button(self, button, account_id=None):
574574
resp_data = response.json()
575575
if not resp_data.get('success') or 'button' not in resp_data:
576576
error_msg = 'Error creating button'
577-
if 'errors' in resp_data:
578-
error_msg += ':' + u'\n'.join(resp_data)
579-
else:
580-
error_msg += '.'
577+
error_msg += ': ' + u'\n'.join(resp_data.get('errors',['Unknown']))
581578
raise RuntimeError(error_msg)
582579

583580
return CoinbasePaymentButton.from_coinbase_dict(resp_data['button'])

0 commit comments

Comments
 (0)