forked from LBRYCommunity/lbry-sdk
don't log tracebacks for expected download errors
This commit is contained in:
parent
d40461de94
commit
076decd6e9
1 changed files with 10 additions and 3 deletions
|
@ -6,8 +6,8 @@ import random
|
||||||
import typing
|
import typing
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from aiohttp.web import Request
|
from aiohttp.web import Request
|
||||||
from lbry.error import ResolveError, InvalidStreamDescriptorError
|
from lbry.error import ResolveError, InvalidStreamDescriptorError, DownloadSDTimeoutError, InsufficientFundsError
|
||||||
from lbry.error import ResolveTimeoutError, DownloadDataTimeoutError
|
from lbry.error import ResolveTimeoutError, DownloadDataTimeoutError, KeyFeeAboveMaxAllowedError
|
||||||
from lbry.utils import cache_concurrent
|
from lbry.utils import cache_concurrent
|
||||||
from lbry.stream.descriptor import StreamDescriptor
|
from lbry.stream.descriptor import StreamDescriptor
|
||||||
from lbry.stream.managed_stream import ManagedStream
|
from lbry.stream.managed_stream import ManagedStream
|
||||||
|
@ -440,6 +440,13 @@ class StreamManager:
|
||||||
error = DownloadDataTimeoutError(stream.sd_hash)
|
error = DownloadDataTimeoutError(stream.sd_hash)
|
||||||
raise error
|
raise error
|
||||||
except Exception as err: # forgive data timeout, don't delete stream
|
except Exception as err: # forgive data timeout, don't delete stream
|
||||||
|
expected = (DownloadSDTimeoutError, DownloadDataTimeoutError, InsufficientFundsError,
|
||||||
|
KeyFeeAboveMaxAllowedError)
|
||||||
|
if isinstance(err, expected):
|
||||||
|
log.warning("Failed to download %s: %s", uri, str(err))
|
||||||
|
elif isinstance(err, asyncio.CancelledError):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
log.exception("Unexpected error downloading stream:")
|
log.exception("Unexpected error downloading stream:")
|
||||||
error = err
|
error = err
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in a new issue