refactor: Expand better-error-logging patterns across the codebase (#15241)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Tim O'Farrell
2026-07-20 03:37:01 -06:00
committed by GitHub
co-authored by openhands
parent 93c0871951
commit 7db8bd4d92
101 changed files with 840 additions and 629 deletions
@@ -180,36 +180,38 @@ class GitlabV1CallbackProcessor(EventCallbackProcessor):
except Exception: # noqa: BLE001
pass
_logger.error(
_logger.exception(
'[GitLab V1] HTTP error sending message to %s: %s. '
'Request payload: %s. Response headers: %s',
url,
error_detail,
payload,
dict(e.response.headers),
exc_info=True,
stack_info=True,
)
raise Exception(f'Failed to send message to agent server: {error_detail}')
raise Exception(
f'Failed to send message to agent server: {error_detail}'
) from e
except httpx.TimeoutException:
error_detail = f'Request timeout after 30 seconds to {url}'
_logger.error(
_logger.exception(
'[GitLab V1] %s. Request payload: %s',
error_detail,
payload,
exc_info=True,
stack_info=True,
)
raise Exception(error_detail)
except httpx.RequestError as e:
error_detail = f'Request error to {url}: {str(e)}'
_logger.error(
_logger.exception(
'[GitLab V1] %s. Request payload: %s',
error_detail,
payload,
exc_info=True,
stack_info=True,
)
raise Exception(error_detail)
raise Exception(error_detail) from e
# -------------------------------------------------------------------------
# Summary orchestration