我有这个错误
raise ClientError(response_data['data']['error'], response.status_code)
ClientError: (300) corrupt or not supported.
如何捕获错误300?
try:
somestuff
except ClientError:
if error = 300: # ?????
print 'catched'
else:
just end the program
感谢您的帮助。
答案 0 :(得分:1)
import errno
try:
..
except ClientError as serr:
if serr.errno == 300:
raise serr