Abri log_job raises a retriable transport error on an HTTP error status 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-03 14:27:43 +00:00
parent 9fefdf81aa
commit d002a3defc

View file

@ -10,6 +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
STD_JOB_CODE = "SCSEXT"
CLIENT_CODE = "HSG"
@ -39,7 +40,11 @@ class AbriClient:
username=self._config.username,
password=self._config.password,
)
response = self._session.post(self._config.endpoint_url, data=body)
try:
response = self._session.post(self._config.endpoint_url, data=body)
response.raise_for_status()
except requests.HTTPError as error:
raise AbriTransportError(str(error)) from error
root = ET.fromstring(response.content)
if root.tag == "response":
return self._parse_rejection(root)