raise proper error when sd is not available
This commit is contained in:
parent
8107e97304
commit
9ba6653475
1 changed files with 2 additions and 0 deletions
|
@ -162,6 +162,8 @@ class StreamDescriptor:
|
||||||
@classmethod
|
@classmethod
|
||||||
async def from_stream_descriptor_blob(cls, loop: asyncio.BaseEventLoop, blob_dir: str,
|
async def from_stream_descriptor_blob(cls, loop: asyncio.BaseEventLoop, blob_dir: str,
|
||||||
blob: AbstractBlob) -> 'StreamDescriptor':
|
blob: AbstractBlob) -> 'StreamDescriptor':
|
||||||
|
if not blob.is_readable():
|
||||||
|
raise InvalidStreamDescriptorError(f"unreadable/missing blob: {blob.blob_hash}")
|
||||||
return await loop.run_in_executor(None, cls._from_stream_descriptor_blob, loop, blob_dir, blob)
|
return await loop.run_in_executor(None, cls._from_stream_descriptor_blob, loop, blob_dir, blob)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue