mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
refactor(list_operator): replace ValueError with InvalidKeyError (#10222)
This commit is contained in:
parent
7e42de1e7b
commit
2d9632d8b9
|
@ -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}")
|
||||
|
|
Loading…
Reference in New Issue
Block a user