algunas soluciones

This commit is contained in:
Juan
2026-05-11 17:30:44 +02:00
parent ce629139c2
commit 9377730de4
4 changed files with 72 additions and 8 deletions
+4 -1
View File
@@ -66,6 +66,9 @@ class CoreClient:
def _post(self, path: str, body: dict) -> Any:
r = self._client.post(path, json=body)
if r.status_code in {404, 409, 422}:
return {"error": r.json()}
# Clave deliberadamente distinta de "error": el cuerpo de un AgentExecution
# correcto ya trae error=None, así que las páginas no podrían distinguir
# "ejecución sin error" de "la API rechazó la petición" si reusáramos "error".
return {"api_error": r.json()}
r.raise_for_status()
return r.json()