mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 06:35:10 +02:00
add error handling
This commit is contained in:
@@ -167,15 +167,22 @@ class HomeAssistant(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Setup signal handling
|
# Setup signal handling
|
||||||
if sys.platform != "win32":
|
if sys.platform != 'win32':
|
||||||
self.loop.add_signal_handler(
|
try:
|
||||||
signal.SIGTERM,
|
self.loop.add_signal_handler(
|
||||||
stop_homeassistant
|
signal.SIGTERM,
|
||||||
)
|
stop_homeassistant
|
||||||
self.loop.add_signal_handler(
|
)
|
||||||
signal.SIGHUP,
|
except ValueError:
|
||||||
restart_homeassistant
|
_LOGGER.warning('Could not bind to SIGTERM.')
|
||||||
)
|
|
||||||
|
try:
|
||||||
|
self.loop.add_signal_handler(
|
||||||
|
signal.SIGHUP,
|
||||||
|
restart_homeassistant
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
_LOGGER.warning('Could not bind to SIGHUP.')
|
||||||
|
|
||||||
# Run forever and catch keyboard interrupt
|
# Run forever and catch keyboard interrupt
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user