Fix udp tracker lib error reporting
This commit is contained in:
parent
5887f90202
commit
669572b0e6
1 changed files with 3 additions and 3 deletions
|
@ -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'''
|
||||||
|
|
Loading…
Reference in a new issue