remove checking for non 200 http codes, exceptions already handle it

This commit is contained in:
Oleg Shlyazhko 2016-01-24 18:28:27 +03:00
parent 9eec34edd1
commit c3bca9af48

View file

@ -43,9 +43,7 @@ class Botan(object):
request = Request(url, request = Request(url,
data=data.encode(), data=data.encode(),
headers={'Content-Type': 'application/json'}) headers={'Content-Type': 'application/json'})
response = urlopen(request) urlopen(request)
if response.getcode() != 200:
return False
return True return True
except HTTPError as error: except HTTPError as error:
self.logger.warn('Botan track error ' + self.logger.warn('Botan track error ' +
@ -53,5 +51,5 @@ class Botan(object):
':' + error.read().decode('utf-8')) ':' + error.read().decode('utf-8'))
return False return False
except URLError as error: except URLError as error:
self.logger.warn('Botan track error ' + error.reason) self.logger.warn('Botan track error ' + str(error.reason))
return False return False