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
38bca6731c
commit
9369cc44e6
|
@ -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)
|
extract_func = _get_file_extract_number_func(key=order_by)
|
||||||
return sorted(array, key=lambda x: extract_func(x), reverse=order == "desc")
|
return sorted(array, key=lambda x: extract_func(x), reverse=order == "desc")
|
||||||
else:
|
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