Skip to content

Commit

Permalink
Raise error when invalid pagination parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed May 21, 2024
1 parent 40fbc94 commit 2b2d9b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/files/sources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
List,
Optional,
Set,
Type,
Tuple,
Type,
TYPE_CHECKING,
Union,
)
Expand Down Expand Up @@ -453,6 +453,11 @@ def list(
raise RequestParameterInvalidException("Server-side search is not supported by this file source.")
if not self.supports_sorting and sort_by:
raise RequestParameterInvalidException("Server-side sorting is not supported by this file source.")
if self.supports_pagination:
if limit is not None and limit < 1:
raise RequestParameterInvalidException("Limit must be greater than 0.")
if offset is not None and offset < 0:
raise RequestParameterInvalidException("Offset must be greater than or equal to 0.")

return self._list(path, recursive, user_context, opts, limit, offset, query)

Expand Down

0 comments on commit 2b2d9b9

Please sign in to comment.