mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 17:16:33 +00:00
Claim exceptions
This commit is contained in:
parent
1040a1624a
commit
265c36b345
@ -27,6 +27,11 @@ class DBusReturnError(DBusError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class DBusParseError(DBusError):
|
||||||
|
"""DBus parse error."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DBus(object):
|
class DBus(object):
|
||||||
"""DBus handler."""
|
"""DBus handler."""
|
||||||
|
|
||||||
@ -61,7 +66,13 @@ class DBus(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
# Parse XML
|
# Parse XML
|
||||||
|
try:
|
||||||
xml = ET.fromstring(data)
|
xml = ET.fromstring(data)
|
||||||
|
except ET.ParseError as err:
|
||||||
|
_LOGGER.error("Can't parse introspect data: %s", err)
|
||||||
|
raise DBusParseError() from None
|
||||||
|
|
||||||
|
# Read available methods
|
||||||
for method in xml.findall(".//method"):
|
for method in xml.findall(".//method"):
|
||||||
self.methods.append(method.get('name'))
|
self.methods.append(method.get('name'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user