Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
rattrayalex committed May 30, 2022
1 parent fec9d9e commit dc06ffe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lithic/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def iter_pages(self: SyncPageT) -> Iterator[SyncPageT]:
def get_next_page(self: SyncPageT) -> SyncPageT:
next_params = self.next_page_params()
if not next_params:
raise StopIteration()
raise RuntimeError(
"No next page expected; please check `.has_next_page()` before calling `.get_next_page()`."
)

options = self._options.copy()
options.params = {**options.params, **next_params}
Expand Down Expand Up @@ -177,7 +179,9 @@ async def iter_pages(self: AsyncPageT) -> AsyncIterator[AsyncPageT]:
async def get_next_page(self: AsyncPageT) -> AsyncPageT:
next_params = self.next_page_params()
if not next_params:
raise StopIteration()
raise RuntimeError(
"No next page expected; please check `.has_next_page()` before calling `.get_next_page()`."
)

options = self._options.copy()
options.params = {**options.params, **next_params}
Expand Down

0 comments on commit dc06ffe

Please sign in to comment.