Suppress specific import errors in the loader
This commit is contained in:
1 parent
5fe50066a6
commit
7938cbffd4
1 file changed
+7
-4
@@ -132,10 +132,13 @@ def get_component(comp_name):
|
|||||||
|
|
||||||
return module
|
return module
|
||||||
|
|
||||||
except ImportError:
|
except ImportError as err:
|
||||||
_LOGGER.exception(
|
# This error happens if for example custom_components/switch
|
||||||
("Error loading %s. Make sure all "
|
# exists and we try to load switch.demo.
|
||||||
"dependencies are installed"), path)
|
if str(err) != "No module named '{}'".format(path):
|
||||||
|
_LOGGER.exception(
|
||||||
|
("Error loading %s. Make sure all "
|
||||||
|
"dependencies are installed"), path)
|
||||||
|
|
||||||
_LOGGER.error("Unable to find component %s", comp_name)
|
_LOGGER.error("Unable to find component %s", comp_name)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user