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(
773
773
:return: Document cursor.
774
774
:rtype: arango.cursor.Cursor
775
775
:raise arango.exceptions.DocumentGetError: If retrieval fails.
776
+ :raise arango.exceptions.SortValidationError: If sort parameters are invalid.
776
777
"""
777
778
assert isinstance (filters , dict ), "filters must be a dict"
778
779
assert is_none_or_int (skip ), "skip must be a non-negative int"
Original file line number Diff line number Diff line change 11
11
from contextlib import contextmanager
12
12
from typing import Any , Iterator , Sequence , Union
13
13
14
- from arango .exceptions import DocumentParseError
14
+ from arango .exceptions import DocumentParseError , SortValidationError
15
15
from arango .typings import Json , Jsons
16
16
17
17
@@ -135,16 +135,16 @@ def validate_sort_parameters(sort: Sequence[Json]) -> bool:
135
135
:type sort: Sequence[Json]
136
136
:return: Validation success.
137
137
:rtype: bool
138
- :raise arango.exceptions.DocumentGetError : If sort parameters are invalid.
138
+ :raise arango.exceptions.SortValidationError : If sort parameters are invalid.
139
139
"""
140
140
assert isinstance (sort , Sequence )
141
141
for param in sort :
142
142
if "sort_by" not in param or "sort_order" not in param :
143
- raise DocumentParseError (
143
+ raise SortValidationError (
144
144
"Each sort parameter must have 'sort_by' and 'sort_order'."
145
145
)
146
146
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'" )
148
148
return True
149
149
150
150
You can’t perform that action at this time.
0 commit comments