From e1a3436f56274138b0b2a26afed3174aee652c09 Mon Sep 17 00:00:00 2001 From: Andrei Markin Date: Mon, 22 Dec 2025 19:51:28 +0400 Subject: [PATCH] [executors] feat: raise exception when source fetcher failed to load --- libs/executors/garf_executors/fetchers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/executors/garf_executors/fetchers.py b/libs/executors/garf_executors/fetchers.py index 1db3e0e..e208bf7 100644 --- a/libs/executors/garf_executors/fetchers.py +++ b/libs/executors/garf_executors/fetchers.py @@ -13,14 +13,16 @@ # limitations under the License. import inspect +import logging import sys from importlib.metadata import entry_points from garf_core import report_fetcher -from opentelemetry import trace from garf_executors.telemetry import tracer +logger = logging.getLogger(name='garf_executors.fetchers') + @tracer.start_as_current_span('find_fetchers') def find_fetchers() -> set[str]: @@ -57,8 +59,10 @@ def get_report_fetcher(source: str) -> type[report_fetcher.ApiReportFetcher]: obj, report_fetcher.ApiReportFetcher ): return getattr(fetcher_module, name) - except ModuleNotFoundError: - continue + except ModuleNotFoundError as e: + raise report_fetcher.ApiReportFetcherError( + f'Failed to load fetcher for source {source}, reason: {e}' + ) raise report_fetcher.ApiReportFetcherError( f'No fetcher available for the source "{source}"' )