mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-09 13:00:34 +00:00
Replacing Exception type from ValueError to ImportError (#9588)
I have restructured the code to ensure uniform handling of ImportError. In place of previously used ValueError, I've adopted the standard practice of raising ImportError with explanatory messages. This modification enhances code readability and clarifies that any problems stem from module importation. @eyurtsev , @baskaryan Thanks
This commit is contained in:
parent
0fa4516ce4
commit
3c4f32c8b8
@ -21,7 +21,7 @@ def _create_client(
|
|||||||
try:
|
try:
|
||||||
import meilisearch
|
import meilisearch
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ValueError(
|
raise ImportError(
|
||||||
"Could not import meilisearch python package. "
|
"Could not import meilisearch python package. "
|
||||||
"Please install it with `pip install meilisearch`."
|
"Please install it with `pip install meilisearch`."
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user