aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-05-31 16:28:08 -0700
committerBryan Newbold <bnewbold@archive.org>2021-05-31 16:28:08 -0700
commitedfe462a77f9211fc31d25610bf3d55e9c97c3f2 (patch)
tree0fe4198045687a74260f4337fb10bf0ee8506e76
parentf0e6db866a6ebe553b05ea66b890f3d50b08a648 (diff)
downloadfuzzycat-edfe462a77f9211fc31d25610bf3d55e9c97c3f2.tar.gz
fuzzycat-edfe462a77f9211fc31d25610bf3d55e9c97c3f2.zip
matching: handle extid not found case (fatcat API HTTP 400 or 404)
-rw-r--r--fuzzycat/matching.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/fuzzycat/matching.py b/fuzzycat/matching.py
index 55a5833..d962255 100644
--- a/fuzzycat/matching.py
+++ b/fuzzycat/matching.py
@@ -64,7 +64,13 @@ def match_release_fuzzy(
value = getattr(ext_ids, attr)
if not value:
continue
- r = api.lookup_release(**{attr: value})
+ try:
+ r = api.lookup_release(**{attr: value})
+ except fatcat_openapi_client.rest.ApiException as err:
+ if err.status in [404, 400]:
+ r = None
+ else:
+ raise err
if r:
return [r]