0

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.

asked Mar 4, 2015 at 21:08
2
  • Will appreciate an upvote/answer select if i answered your question. Commented Mar 4, 2015 at 21:15
  • 1
    Thank you. I can't upvote because I don't have enough reputation, but I accepted your answer if it helps you. Commented Mar 4, 2015 at 22:01

1 Answer 1

1
import errno
try:
 ..
except ClientError as serr:
 if serr.errno == 300: 
 raise serr
answered Mar 4, 2015 at 21:12
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.