File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -773,6 +773,7 @@ def find(
773773 :return: Document cursor.
774774 :rtype: arango.cursor.Cursor
775775 :raise arango.exceptions.DocumentGetError: If retrieval fails.
776+ :raise arango.exceptions.SortValidationError: If sort parameters are invalid.
776777 """
777778 assert isinstance (filters , dict ), "filters must be a dict"
778779 assert is_none_or_int (skip ), "skip must be a non-negative int"
Original file line number Diff line number Diff line change 1111from contextlib import contextmanager
1212from typing import Any , Iterator , Sequence , Union
1313
14- from arango .exceptions import DocumentParseError
14+ from arango .exceptions import DocumentParseError , SortValidationError
1515from arango .typings import Json , Jsons
1616
1717
@@ -135,16 +135,16 @@ def validate_sort_parameters(sort: Sequence[Json]) -> bool:
135135 :type sort: Sequence[Json]
136136 :return: Validation success.
137137 :rtype: bool
138- :raise arango.exceptions.DocumentGetError : If sort parameters are invalid.
138+ :raise arango.exceptions.SortValidationError : If sort parameters are invalid.
139139 """
140140 assert isinstance (sort , Sequence )
141141 for param in sort :
142142 if "sort_by" not in param or "sort_order" not in param :
143- raise DocumentParseError (
143+ raise SortValidationError (
144144 "Each sort parameter must have 'sort_by' and 'sort_order'."
145145 )
146146 if param ["sort_order" ].upper () not in ["ASC" , "DESC" ]:
147- raise DocumentParseError ("'sort_order' must be either 'ASC' or 'DESC'" )
147+ raise SortValidationError ("'sort_order' must be either 'ASC' or 'DESC'" )
148148 return True
149149
150150
You can’t perform that action at this time.
0 commit comments