From 34e401b9a4dad5e2755d92a7dbcbeaec1c245670 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 10 Oct 2018 20:24:20 -0400 Subject: [PATCH] trap errors --- aioupnp/protocols/ssdp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aioupnp/protocols/ssdp.py b/aioupnp/protocols/ssdp.py index c7d0c82..fb69540 100644 --- a/aioupnp/protocols/ssdp.py +++ b/aioupnp/protocols/ssdp.py @@ -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) transport.close() return result - except TimeoutError: + except asyncio.TimeoutError: pass + except Exception as err: + log.error(err) transport.close() raise UPnPError("M-SEARCH for {}:{} timed out".format(gateway_address, SSDP_PORT))