mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Abri log_job treats a malformed relay response as retriable, never as success or rejection 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ff34872c24
commit
0df1d866fe
1 changed files with 5 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue