Skip to content

Commit dd10f25

Browse files
[executors] feat: raise exception when source fetcher failed to load
1 parent ccbc3d3 commit dd10f25

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

libs/executors/garf_executors/fetchers.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
# limitations under the License.
1414

1515
import inspect
16+
import logging
1617
import sys
1718
from importlib.metadata import entry_points
1819

1920
from garf_core import report_fetcher
20-
from opentelemetry import trace
2121

2222
from garf_executors.telemetry import tracer
2323

24+
logger = logging.getLogger(name='garf_executors.fetchers')
25+
2426

2527
@tracer.start_as_current_span('find_fetchers')
2628
def find_fetchers() -> set[str]:
@@ -57,8 +59,10 @@ def get_report_fetcher(source: str) -> type[report_fetcher.ApiReportFetcher]:
5759
obj, report_fetcher.ApiReportFetcher
5860
):
5961
return getattr(fetcher_module, name)
60-
except ModuleNotFoundError:
61-
continue
62+
except ModuleNotFoundError as e:
63+
raise report_fetcher.ApiReportFetcherError(
64+
f'Failed to load fetcher for source {source}, reason: {e}'
65+
)
6266
raise report_fetcher.ApiReportFetcherError(
6367
f'No fetcher available for the source "{source}"'
6468
)

0 commit comments

Comments
 (0)