Skip to content

Commit

Permalink
better logging for errors and version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gross committed Jan 18, 2012
1 parent dbc54b5 commit c27862f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -22,7 +22,7 @@
from distutils.core import setup

setup(name='greplin-tornado-stripe',
version='0.1',
version='0.2',
description='A client for the Stripe API',
license='Apache',
author='Greplin, Inc.',
Expand Down
8 changes: 6 additions & 2 deletions src/greplin/tornado/stripe.py
Expand Up @@ -183,7 +183,7 @@ def _call(self, callback, method, extra_params):
params = {
'method':method,
'key':self._key,
'client':{'type':'binding', 'language':'python_tornado', 'version':'1.4.3'}
'client':{'type':'binding', 'language':'python_tornado', 'version':'0.2'}
}
if extra_params:
params.update(extra_params)
Expand All @@ -194,7 +194,11 @@ def _call(self, callback, method, extra_params):

def _parse_response(self, callback, method, response):
"""Parse a response from the API"""
res = escape.json_decode(response.body)
try:
res = escape.json_decode(response.body)
except Exception, e:
e.args += ('API response was: %s' % response,)
raise
if self._raise_errors and res.get('error'):
err = {
'card_error': CardException,
Expand Down

0 comments on commit c27862f

Please sign in to comment.