diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py index 4506a1747..08a0a7261 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py @@ -217,8 +217,15 @@ def create( source_module: SourceModule = importlib.import_module( f"waste_collection_schedule.source.{source_name}" ) - except ImportError: - _LOGGER.error(f"source not found: {source_name}") + except ImportError as e: + if str(e).startswith( + f"No module named 'waste_collection_schedule.source.{source_name}'" + ): + _LOGGER.error(f"source not found: {source_name}") + else: + _LOGGER.error( + f"error loading source {source_name}:\n{e} \n{traceback.format_exc()}" + ) return None # create source