Fix udp tracker lib error reporting

This commit is contained in:
shortcutme 2018-08-26 22:55:31 +02:00
parent 5887f90202
commit 669572b0e6
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class UdpTrackerClient:
return trans return trans
def error(self, message): def error(self, message):
print('error: {}'.format(message)) raise Exception('error: {}'.format(message))
def _send(self, action, payload=None): def _send(self, action, payload=None):
if not payload: if not payload:
@ -140,7 +140,7 @@ class UdpTrackerClient:
elif action == SCRAPE: elif action == SCRAPE:
return self._process_scrape(payload, trans) return self._process_scrape(payload, trans)
elif action == ERROR: elif action == ERROR:
return self._proecss_error(payload, trans) return self._process_error(payload, trans)
else: else:
raise UdpTrackerClientException( raise UdpTrackerClientException(
'Unknown action response: {}'.format(action)) 'Unknown action response: {}'.format(action))
@ -202,7 +202,7 @@ class UdpTrackerClient:
it here for the possibility. it here for the possibility.
''' '''
self.error(payload) self.error(payload)
return payload return False
def _generate_peer_id(self): def _generate_peer_id(self):
'''http://www.bittorrent.org/beps/bep_0020.html''' '''http://www.bittorrent.org/beps/bep_0020.html'''