mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Log exceptions that happen during service call (#11394)
* Log exceptions that happen during service call * Lint
This commit is contained in:
parent
cb899a9465
commit
1b4be0460c
@ -1024,6 +1024,7 @@ class ServiceRegistry(object):
|
||||
|
||||
service_call = ServiceCall(domain, service, service_data, call_id)
|
||||
|
||||
try:
|
||||
if service_handler.is_callback:
|
||||
service_handler.func(service_call)
|
||||
fire_service_executed()
|
||||
@ -1036,7 +1037,9 @@ class ServiceRegistry(object):
|
||||
service_handler.func(service_call)
|
||||
fire_service_executed()
|
||||
|
||||
self._hass.async_add_job(execute_service)
|
||||
yield from self._hass.async_add_job(execute_service)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.exception('Error executing service %s', service_call)
|
||||
|
||||
|
||||
class Config(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user