[engine] Nicer handling of module exceptions

Do not throw exceptions during exception handling, that causes really
hard-to-interpret error messages.

Instead, log a message and throw outside the exception handler (the code
could do with some cleanup, but is localized enough for now).

see #367
This commit is contained in:
Tobias Witek 2019-03-01 21:02:51 +01:00
parent 8db3435ddc
commit 1359f1000f
2 changed files with 7 additions and 9 deletions

View file

@ -11,14 +11,8 @@ Parameters:
* nic.format: Format string (defaults to "{intf} {state} {ip} {ssid}")
"""
import logging
log = logging.getLogger(__name__)
try:
import netifaces
import subprocess
except ImportError as e:
log.warning("failed to import nic: {}".format(e))
import netifaces
import subprocess21
import bumblebee.util
import bumblebee.input