Skip to content

Commit

Permalink
Change ValueError exception to ModuleNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
aimtsou authored Jun 20, 2024
1 parent 9784d6d commit cec44c1
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 cec44c1

Please sign in to comment.