catch availability check error

This commit is contained in:
Jack 2016-11-01 13:05:19 -04:00
parent d1b23e25d9
commit 4cffc32328
2 changed files with 6 additions and 1 deletions

View file

@ -99,7 +99,7 @@ class EncryptedFileReflectorClient(Protocol):
log.debug('Finished sending data via reflector')
self.factory.finished_deferred.callback(True)
else:
log.debug('reflector finished: %s', reason)
log.debug('Reflector finished: %s', reason)
self.factory.finished_deferred.callback(reason)
# IConsumer stuff

View file

@ -39,7 +39,12 @@ def _reflect_if_unavailable(reflector_has_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):
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.addErrback(_catch_error)
return d