Skip to content

Commit

Permalink
Merge pull request #652 from aimtsou/aimtsou_fixexception
Browse files Browse the repository at this point in the history
Change ValueError exception to ModuleNotFoundError
  • Loading branch information
wangxiaoying authored Jun 20, 2024
2 parents 9784d6d + cec44c1 commit 109db3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connectorx-python/connectorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 109db3c

Please sign in to comment.