Increase logging level of errors while doing jobs (#4429)
This commit is contained in:
parent
c8bc1e3c5d
commit
38d201a54a
1 changed files with 7 additions and 14 deletions
|
@ -306,21 +306,14 @@ class HomeAssistant(object):
|
||||||
@callback
|
@callback
|
||||||
def _async_exception_handler(self, loop, context):
|
def _async_exception_handler(self, loop, context):
|
||||||
"""Handle all exception inside the core loop."""
|
"""Handle all exception inside the core loop."""
|
||||||
message = context.get('message')
|
kwargs = {}
|
||||||
if message:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"Error inside async loop: %s",
|
|
||||||
message
|
|
||||||
)
|
|
||||||
|
|
||||||
# for debug modus
|
|
||||||
exception = context.get('exception')
|
exception = context.get('exception')
|
||||||
if exception is not None:
|
if exception:
|
||||||
exc_info = (type(exception), exception, exception.__traceback__)
|
kwargs['exc_info'] = (type(exception), exception,
|
||||||
_LOGGER.debug(
|
exception.__traceback__)
|
||||||
"Exception inside async loop: ",
|
|
||||||
exc_info=exc_info
|
_LOGGER.error('Error doing job: %s', context['message'],
|
||||||
)
|
**kwargs)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_stop_handler(self, *args):
|
def _async_stop_handler(self, *args):
|
||||||
|
|
Loading…
Add table
Reference in a new issue