refactor(list_operator): replace ValueError with InvalidKeyError (#10222)

This commit is contained in:
-LAN- 2024-11-04 15:23:08 +08:00 committed by Yeuoly
parent 7e42de1e7b
commit 2d9632d8b9
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61

View File

@ -295,4 +295,4 @@ def _order_file(*, order: Literal["asc", "desc"], order_by: str = "", array: Seq
extract_func = _get_file_extract_number_func(key=order_by)
return sorted(array, key=lambda x: extract_func(x), reverse=order == "desc")
else:
raise ValueError(f"Invalid order key: {order_by}")
raise InvalidKeyError(f"Invalid order key: {order_by}")