Skip to content

Commit ec1ddd7

Browse files
widnyanalepture
authored andcommitted
show original error message (#276) (lepture#278)
1 parent 9aab7d6 commit ec1ddd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

example/twitter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ def tweet():
5959
resp = twitter.post('statuses/update.json', data={
6060
'status': status
6161
})
62+
6263
if resp.status == 403:
63-
flash('Your tweet was too long.')
64+
flash("Error: #%d, %s " % (
65+
resp.data.get('errors')[0].get('code'),
66+
resp.data.get('errors')[0].get('message'))
67+
)
6468
elif resp.status == 401:
6569
flash('Authorization error with Twitter.')
6670
else:

0 commit comments

Comments
 (0)