еще логи
Deploy / deploy (push) Successful in 56s

This commit is contained in:
Раис Юсупалиев
2026-06-27 18:42:50 +03:00
parent a2d9a243f7
commit 7287a1398e
2 changed files with 79 additions and 11 deletions
+24 -11
View File
@@ -214,17 +214,16 @@ class CSEClient:
operation: str,
request_error_message: str,
) -> None:
for prop in root.properties:
if prop.key == "Error":
codes = [item.value for item in prop.items if item.value]
log.warning(
"cse_response_error",
operation=operation,
error_codes=codes,
)
raise CSERequestError(
f"{request_error_message} application error {codes}."
)
error_codes = _response_error_codes(root)
if error_codes:
log.warning(
"cse_response_error",
operation=operation,
error_codes=error_codes,
)
raise CSERequestError(
f"{request_error_message} application error {error_codes}."
)
@staticmethod
def _should_retry(status_code: int) -> bool:
@@ -238,6 +237,20 @@ def _response_excerpt(text: str, *, limit: int = 1000) -> str:
return " ".join(text.split())[:limit]
def _response_error_codes(root: Element) -> list[str]:
codes: list[str] = []
_collect_response_error_codes(root, codes)
return codes
def _collect_response_error_codes(element: Element, codes: list[str]) -> None:
for prop in element.properties:
if prop.key == "Error":
codes.extend(item.value for item in prop.items if item.value)
for child in (*element.items, *element.tables):
_collect_response_error_codes(child, codes)
class CSEProvider(DeliveryProvider):
name = CSE_PROVIDER_NAME