Skip to content

Commit dc06ffe

Browse files
committed
Bump
1 parent fec9d9e commit dc06ffe

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lithic/_base_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ def iter_pages(self: SyncPageT) -> Iterator[SyncPageT]:
104104
def get_next_page(self: SyncPageT) -> SyncPageT:
105105
next_params = self.next_page_params()
106106
if not next_params:
107-
raise StopIteration()
107+
raise RuntimeError(
108+
"No next page expected; please check `.has_next_page()` before calling `.get_next_page()`."
109+
)
108110

109111
options = self._options.copy()
110112
options.params = {**options.params, **next_params}
@@ -177,7 +179,9 @@ async def iter_pages(self: AsyncPageT) -> AsyncIterator[AsyncPageT]:
177179
async def get_next_page(self: AsyncPageT) -> AsyncPageT:
178180
next_params = self.next_page_params()
179181
if not next_params:
180-
raise StopIteration()
182+
raise RuntimeError(
183+
"No next page expected; please check `.has_next_page()` before calling `.get_next_page()`."
184+
)
181185

182186
options = self._options.copy()
183187
options.params = {**options.params, **next_params}

0 commit comments

Comments
 (0)