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:
Aashish Saini 2023-08-22 20:04:05 +05:30 committed by GitHub
parent 0fa4516ce4
commit 3c4f32c8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`."
) )