Don't send DBusProgramError to sentry (#2294)

* Don't send DBusProgramError to sentry

* Add message
This commit is contained in:
Pascal Vizeli 2020-11-24 14:18:00 +01:00 committed by GitHub
parent 056926242f
commit 621eb4c4c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ from typing import Any, Awaitable, Dict
import sentry_sdk
from ...exceptions import DBusError, DBusInterfaceError
from ...exceptions import DBusError, DBusInterfaceError, DBusProgramError
from ...utils.gdbus import DBus
from ..const import (
DBUS_ATTR_CONNECTION_ENABLED,
@ -105,6 +105,9 @@ class NetworkManager(DBusInterface):
# Connect to interface
try:
await interface.connect()
except DBusProgramError as err:
_LOGGER.warning("Can't process %s: %s", device, err)
continue
except Exception as err: # pylint: disable=broad-except
_LOGGER.exception("Error while processing interface: %s", err)
sentry_sdk.capture_exception(err)