mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-26 09:07:43 +01:00
remove checking for non 200 http codes, exceptions already handle it
This commit is contained in:
parent
9eec34edd1
commit
c3bca9af48
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue