forked from LBRYCommunity/lbry-sdk
Merge pull request #1868 from lbryio/fix_error_response
format error dict on get
This commit is contained in:
commit
f8dc0f298e
1 changed files with 9 additions and 5 deletions
|
@ -1571,12 +1571,16 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
stream = await self.stream_manager.download_stream_from_uri(
|
try:
|
||||||
uri, self.exchange_rate_manager, file_name, timeout
|
stream = await self.stream_manager.download_stream_from_uri(
|
||||||
)
|
uri, self.exchange_rate_manager, file_name, timeout
|
||||||
if stream:
|
)
|
||||||
|
if not stream:
|
||||||
|
raise DownloadSDTimeout(uri)
|
||||||
|
except Exception as e:
|
||||||
|
return {"error": str(e)}
|
||||||
|
else:
|
||||||
return stream.as_dict()
|
return stream.as_dict()
|
||||||
raise DownloadSDTimeout(uri)
|
|
||||||
|
|
||||||
@requires(STREAM_MANAGER_COMPONENT)
|
@requires(STREAM_MANAGER_COMPONENT)
|
||||||
async def jsonrpc_file_set_status(self, status, **kwargs):
|
async def jsonrpc_file_set_status(self, status, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue