mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
Print better error message when loader fails with ValueError
This commit is contained in:
parent
7ce753b76f
commit
7fb1979f16
@ -30,6 +30,8 @@ def get_component(domain):
|
|||||||
module = importlib.import_module(path)
|
module = importlib.import_module(path)
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
_LOGGER.debug(err)
|
_LOGGER.debug(err)
|
||||||
|
except ValueError:
|
||||||
|
raise ESPHomeYAMLError("Error finding component '{}'.".format(domain))
|
||||||
else:
|
else:
|
||||||
_COMPONENT_CACHE[domain] = module
|
_COMPONENT_CACHE[domain] = module
|
||||||
return module
|
return module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user