trap errors

This commit is contained in:
Jack Robison 2018-10-10 20:24:20 -04:00
parent a979c67ca5
commit 34e401b9a4
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -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))