From 987575580d50429102cf8eee02a7bdbcd8a99ee0 Mon Sep 17 00:00:00 2001 From: Ferran Llamas Date: Fri, 24 Nov 2023 12:09:26 +0100 Subject: [PATCH] more explicit exception --- nucliadb/nucliadb/search/predict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nucliadb/nucliadb/search/predict.py b/nucliadb/nucliadb/search/predict.py index 1cc55446fe..32efdcb712 100644 --- a/nucliadb/nucliadb/search/predict.py +++ b/nucliadb/nucliadb/search/predict.py @@ -315,7 +315,7 @@ async def check_response( try: detail = await resp.json() - except Exception: + except json.decoder.JSONDecodeError: detail = await resp.text() logger.error(f"Predict API error at {resp.url}: {detail}") raise ProxiedPredictAPIError(status=resp.status, detail=detail)