Browse Source

Fix crash on an empty response

This check was a leftover from the resumeKey pagination, where empty responses are supposed to be impossible. With the page pagination, they are possible.
master
JustAnotherArchivist 2 years ago
parent
commit
5bc3d4b020
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      ia-cdx-search

+ 3
- 1
ia-cdx-search View File

@@ -51,7 +51,9 @@ async def wait_first_and_print(tasks):
return
task = tasks.popleft()
url, code, o, connection = await task
assert o, 'got empty response'
if not o:
print(f'Completed processing page {task._ia_cdx_page} (0 results)', file = sys.stderr)
return task._ia_cdx_page, connection
fields = o[0]
assert all(len(v) == len(fields) for v in o[1:]), 'got unexpected response format'
for row in o[1:]:


Loading…
Cancel
Save