in code I have this error
raise ClientError(response_data['data']['error'], response.status_code)
ClientError: (300) corrupt or not supported.
How to catch error 300?
try:
somestuff
except ClientError:
if error = 300: # ?????
print 'catched'
else:
just end the program
Thanks for your help.
-
Will appreciate an upvote/answer select if i answered your question.Illusionist– Illusionist2015年03月04日 21:15:59 +00:00Commented Mar 4, 2015 at 21:15
-
1Thank you. I can't upvote because I don't have enough reputation, but I accepted your answer if it helps you.user3052737– user30527372015年03月04日 22:01:58 +00:00Commented Mar 4, 2015 at 22:01
1 Answer 1
import errno
try:
..
except ClientError as serr:
if serr.errno == 300:
raise serr
answered Mar 4, 2015 at 21:12
Illusionist
5,54912 gold badges49 silver badges82 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py