From edfe462a77f9211fc31d25610bf3d55e9c97c3f2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 31 May 2021 16:28:08 -0700 Subject: matching: handle extid not found case (fatcat API HTTP 400 or 404) --- fuzzycat/matching.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fuzzycat') 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] -- cgit v1.2.3