@@ -198,7 +198,7 @@ def index(self, uid: str) -> Index:
198
198
"""
199
199
if uid is not None :
200
200
return Index (self .config , uid = uid )
201
- raise Exception ("The index UID should not be None" )
201
+ raise ValueError ("The index UID should not be None" )
202
202
203
203
def get_all_stats (self ) -> Dict [str , Any ]:
204
204
"""Get all stats of Meilisearch
@@ -315,7 +315,7 @@ def update_key(self, key_or_uid: str, options: Dict[str, Any]) -> Dict[str, Any]
315
315
316
316
Parameters
317
317
----------
318
- key :
318
+ key_or_uid :
319
319
The key or the uid of the key for which to update the information.
320
320
options:
321
321
The information to use in creating the key (ex: { 'description': 'Search Key', 'expiresAt': '22-01-01' }). Note that if an
@@ -566,15 +566,15 @@ def generate_tenant_token(
566
566
"""
567
567
# Validate all fields
568
568
if api_key == "" or api_key is None and self .config .api_key is None :
569
- raise Exception (
569
+ raise ValueError (
570
570
"An api key is required in the client or should be passed as an argument."
571
571
)
572
572
if api_key_uid == "" or api_key_uid is None or self ._valid_uuid (api_key_uid ) is False :
573
- raise Exception ("An uid is required and must comply to the uuid4 format." )
573
+ raise ValueError ("An uid is required and must comply to the uuid4 format." )
574
574
if not search_rules or search_rules == ["" ]:
575
- raise Exception ("The search_rules field is mandatory and should be defined." )
575
+ raise ValueError ("The search_rules field is mandatory and should be defined." )
576
576
if expires_at and expires_at < datetime .datetime .utcnow ():
577
- raise Exception ("The date expires_at should be in the future." )
577
+ raise ValueError ("The date expires_at should be in the future." )
578
578
579
579
# Standard JWT header for encryption with SHA256/HS256 algorithm
580
580
header = {"typ" : "JWT" , "alg" : "HS256" }
0 commit comments