forked from LBRYCommunity/lbry-sdk
catch errors
This commit is contained in:
parent
a5d21081b9
commit
3c5fb6490d
2 changed files with 8 additions and 2 deletions
|
@ -2,6 +2,7 @@ from random import choice
|
||||||
import logging
|
import logging
|
||||||
from twisted.internet import defer, task
|
from twisted.internet import defer, task
|
||||||
from twisted.internet.error import ConnectingCancelledError
|
from twisted.internet.error import ConnectingCancelledError
|
||||||
|
from twisted.web._newclient import ResponseNeverReceived
|
||||||
import treq
|
import treq
|
||||||
from lbrynet.core.utils import DeferredDict
|
from lbrynet.core.utils import DeferredDict
|
||||||
from lbrynet.core.Error import DownloadCanceledError
|
from lbrynet.core.Error import DownloadCanceledError
|
||||||
|
@ -132,9 +133,10 @@ class HTTPBlobDownloader:
|
||||||
yield self.blob_manager.blob_completed(blob, should_announce=should_announce)
|
yield self.blob_manager.blob_completed(blob, should_announce=should_announce)
|
||||||
self.downloaded_blob_hashes.append(blob.blob_hash)
|
self.downloaded_blob_hashes.append(blob.blob_hash)
|
||||||
break
|
break
|
||||||
except (IOError, Exception, defer.CancelledError, ConnectingCancelledError) as e:
|
except (IOError, Exception, defer.CancelledError, ConnectingCancelledError, ResponseNeverReceived) as e:
|
||||||
if isinstance(
|
if isinstance(
|
||||||
e, (DownloadCanceledError, defer.CancelledError, ConnectingCancelledError)
|
e, (DownloadCanceledError, defer.CancelledError, ConnectingCancelledError,
|
||||||
|
ResponseNeverReceived)
|
||||||
) or 'closed file' in str(e):
|
) or 'closed file' in str(e):
|
||||||
# some other downloader finished first or it was simply cancelled
|
# some other downloader finished first or it was simply cancelled
|
||||||
log.info("Mirror download cancelled: %s", blob.blob_hash)
|
log.info("Mirror download cancelled: %s", blob.blob_hash)
|
||||||
|
|
|
@ -94,6 +94,10 @@ class Account(BaseAccount):
|
||||||
try:
|
try:
|
||||||
txid, nout = maybe_claim_id.split(':')
|
txid, nout = maybe_claim_id.split(':')
|
||||||
tx = await self.ledger.db.get_transaction(txid=txid)
|
tx = await self.ledger.db.get_transaction(txid=txid)
|
||||||
|
if not tx:
|
||||||
|
log.warning("Claim migration failed to find a transaction for outpoint %s:%i")
|
||||||
|
results['previous-corrupted'] += 1
|
||||||
|
continue
|
||||||
if tx.outputs[int(nout)].script.is_claim_involved:
|
if tx.outputs[int(nout)].script.is_claim_involved:
|
||||||
results['previous-success'] += 1
|
results['previous-success'] += 1
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue