Log exception occurred in WS service call command (#21584)

This commit is contained in:
Jason Hu 2019-03-03 21:22:22 -08:00 committed by Paulus Schoutsen
parent 48a2e50f84
commit ee6f09dd29

View file

@ -151,9 +151,11 @@ async def handle_call_service(hass, connection, msg):
connection.send_message(messages.error_message(
msg['id'], const.ERR_NOT_FOUND, 'Service not found.'))
except HomeAssistantError as err:
connection.logger.exception(err)
connection.send_message(messages.error_message(
msg['id'], const.ERR_HOME_ASSISTANT_ERROR, '{}'.format(err)))
except Exception as err: # pylint: disable=broad-except
connection.logger.exception(err)
connection.send_message(messages.error_message(
msg['id'], const.ERR_UNKNOWN_ERROR, '{}'.format(err)))