From 0df1d866fee880068e9bc13a8383e375688c29b3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 3 Jul 2026 14:29:41 +0000 Subject: [PATCH] =?UTF-8?q?Abri=20log=5Fjob=20treats=20a=20malformed=20rel?= =?UTF-8?q?ay=20response=20as=20retriable,=20never=20as=20success=20or=20r?= =?UTF-8?q?ejection=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- infrastructure/abri/abri_client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/infrastructure/abri/abri_client.py b/infrastructure/abri/abri_client.py index 9d69efd86..302ec54f8 100644 --- a/infrastructure/abri/abri_client.py +++ b/infrastructure/abri/abri_client.py @@ -10,7 +10,7 @@ from domain.abri.models import ( ) from infrastructure.abri.config import AbriConfig from infrastructure.abri.envelope import serialise_relay_request -from infrastructure.abri.errors import AbriTransportError +from infrastructure.abri.errors import AbriResponseParseError, AbriTransportError STD_JOB_CODE = "SCSEXT" CLIENT_CODE = "HSG" @@ -45,7 +45,10 @@ class AbriClient: response.raise_for_status() except requests.RequestException as error: raise AbriTransportError(str(error)) from error - root = ET.fromstring(response.content) + try: + root = ET.fromstring(response.content) + except ET.ParseError as error: + raise AbriResponseParseError(str(error)) from error if root.tag == "response": return self._parse_rejection(root) job_logged = root.find("Jobs/Job_logged")