From cec44c18a8c3a1c901975db7fcfa29590d81ac26 Mon Sep 17 00:00:00 2001 From: Aimilios Tsouvelekakis Date: Thu, 20 Jun 2024 12:15:02 +0200 Subject: [PATCH] Change ValueError exception to ModuleNotFoundError --- connectorx-python/connectorx/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connectorx-python/connectorx/__init__.py b/connectorx-python/connectorx/__init__.py index e49f5d400..1dd7178a5 100644 --- a/connectorx-python/connectorx/__init__.py +++ b/connectorx-python/connectorx/__init__.py @@ -483,7 +483,10 @@ def try_import_module(name: str): try: return importlib.import_module(name) except ModuleNotFoundError: - raise ValueError(f"You need to install {name.split('.')[0]} first") + raise ModuleNotFoundError( + f"You need to install the '{name.split('.')[0]}' module first " + "before trying to import it" + ) _ServerBackendT = TypeVar(