From d6307cabc37c6dadf0c492b53041c679dbcaec80 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 19 Oct 2018 11:45:01 -0400 Subject: [PATCH] log get failure --- aioupnp/gateway.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/aioupnp/gateway.py b/aioupnp/gateway.py index 6bd38aa..c5f0cbc 100644 --- a/aioupnp/gateway.py +++ b/aioupnp/gateway.py @@ -170,11 +170,12 @@ class Gateway: unicast) try: gateway = cls(datagram, m_search_args, lan_address, gateway_address) + log.debug('get gateway descriptor %s', datagram.location) await gateway.discover_commands(soap_socket) log.debug('found gateway device %s', datagram.location) return gateway - except (asyncio.TimeoutError, UPnPError): - log.debug("get %s timed out, looking for other devices", datagram.location) + except (asyncio.TimeoutError, UPnPError) as err: + log.debug("get %s failed (%s), looking for other devices", datagram.location, str(err)) ignored.add(datagram.location) continue @@ -219,11 +220,14 @@ class Gateway: async def register_commands(self, service: Service, soap_socket: socket.socket = None): if not service.SCPDURL: raise UPnPError("no scpd url") + + log.debug("get descriptor for %s from %s", service.serviceType, service.SCPDURL) service_dict, xml_bytes, get_err = await scpd_get(service.SCPDURL, self.base_ip.decode(), self.port) self._service_descriptors[service.SCPDURL] = xml_bytes if get_err is not None: - raise get_err + log.debug("failed to get descriptor for %s from %s", service.serviceType, service.SCPDURL) + return if not service_dict: return @@ -259,3 +263,4 @@ class Gateway: self._unsupported_actions[service.serviceType] = s log.debug("available command for %s does not have a wrapper implemented: %s %s %s", service.serviceType, name, inputs, outputs) + log.debug("registered service %s", service.serviceType)