Skip to content

Commit 3a75403

Browse files
committed
better error messages
1 parent 074f696 commit 3a75403

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

example_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def main():
77

88
result = client.execute('''
99
{
10-
allFilms {
10+
allFilmsa {
1111
films {
1212
title
1313
}

graphqlclient/client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def _send(self, query, variables):
1515
'Content-Type': 'application/json'}
1616

1717
req = urllib2.Request(self.endpoint, json.dumps(data), headers)
18-
response = urllib2.urlopen(req)
1918

20-
return response.read()
19+
try:
20+
response = urllib2.urlopen(req)
21+
return response.read()
22+
except urllib2.HTTPError, e:
23+
print(e.read())
24+
print('')
25+
raise e

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup
22

33
setup(name='graphqlclient',
4-
version='0.1.0',
4+
version='0.1.1',
55
description='Simple GraphQL client for Python 2.7+',
66
url='https://github.com/graphcool/python-graphql-client',
77
author='graph.cool',

0 commit comments

Comments
 (0)