trap errors
This commit is contained in:
parent
a979c67ca5
commit
34e401b9a4
1 changed files with 3 additions and 1 deletions
|
@ -146,7 +146,9 @@ async def fuzzy_m_search(lan_address: str, gateway_address: str, timeout: int =
|
||||||
result = await protocol.m_search(address=gateway_address, timeout=timeout, datagram_args=args)
|
result = await protocol.m_search(address=gateway_address, timeout=timeout, datagram_args=args)
|
||||||
transport.close()
|
transport.close()
|
||||||
return result
|
return result
|
||||||
except TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
except Exception as err:
|
||||||
|
log.error(err)
|
||||||
transport.close()
|
transport.close()
|
||||||
raise UPnPError("M-SEARCH for {}:{} timed out".format(gateway_address, SSDP_PORT))
|
raise UPnPError("M-SEARCH for {}:{} timed out".format(gateway_address, SSDP_PORT))
|
||||||
|
|
Loading…
Reference in a new issue