catch availability check error
This commit is contained in:
parent
d1b23e25d9
commit
4cffc32328
2 changed files with 6 additions and 1 deletions
|
@ -99,7 +99,7 @@ class EncryptedFileReflectorClient(Protocol):
|
||||||
log.debug('Finished sending data via reflector')
|
log.debug('Finished sending data via reflector')
|
||||||
self.factory.finished_deferred.callback(True)
|
self.factory.finished_deferred.callback(True)
|
||||||
else:
|
else:
|
||||||
log.debug('reflector finished: %s', reason)
|
log.debug('Reflector finished: %s', reason)
|
||||||
self.factory.finished_deferred.callback(reason)
|
self.factory.finished_deferred.callback(reason)
|
||||||
|
|
||||||
# IConsumer stuff
|
# IConsumer stuff
|
||||||
|
|
|
@ -39,7 +39,12 @@ def _reflect_if_unavailable(reflector_has_stream, lbry_file, reflector_server):
|
||||||
return _reflect_stream(lbry_file, reflector_server)
|
return _reflect_stream(lbry_file, reflector_server)
|
||||||
|
|
||||||
|
|
||||||
|
def _catch_error(err):
|
||||||
|
log.error(err.getTraceback())
|
||||||
|
|
||||||
|
|
||||||
def check_and_restore_availability(lbry_file, reflector_server):
|
def check_and_restore_availability(lbry_file, reflector_server):
|
||||||
d = _check_if_reflector_has_stream(lbry_file, reflector_server)
|
d = _check_if_reflector_has_stream(lbry_file, reflector_server)
|
||||||
d.addCallback(lambda send_stream: _reflect_if_unavailable(send_stream, lbry_file, reflector_server))
|
d.addCallback(lambda send_stream: _reflect_if_unavailable(send_stream, lbry_file, reflector_server))
|
||||||
|
d.addErrback(_catch_error)
|
||||||
return d
|
return d
|
||||||
|
|
Loading…
Add table
Reference in a new issue