Skip to content

Commit e69207e

Browse files
committed
Don't consider no results an OAI harvest failure.
1 parent 5b51e5f commit e69207e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

share/harvest/oai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def fetch_page(self, url: furl, token: str=None) -> (list, str):
8989
parsed = etree.fromstring(resp.content, parser=etree.XMLParser(recover=True))
9090

9191
error = parsed.xpath('//ns0:error', namespaces=self.namespaces)
92-
if error:
92+
if error and (len(error) > 1 or error[0].get('code') != 'noRecordsMatch'):
9393
raise OAIHarvestException(error[0].get('code'), error[0].text)
9494

9595
records = parsed.xpath('//ns0:record', namespaces=self.namespaces)

0 commit comments

Comments
 (0)