MCPcopy Create free account
hub / github.com/github/gh-aw / detectErrors

Function detectErrors

actions/setup/js/detect_agent_errors.cjs:97–106  ·  view source on GitHub ↗

* Detect known error patterns in a log string and return detection results. * @param {string} logContent - Contents of the agent stdio log * @returns {{ inferenceAccessError: boolean, mcpPolicyError: boolean, agenticEngineTimeout: boolean, modelNotSupportedError: boolean, http400ResponseError: boo

(logContent)

Source from the content-addressed store, hash-verified

95 * @returns {{ inferenceAccessError: boolean, mcpPolicyError: boolean, agenticEngineTimeout: boolean, modelNotSupportedError: boolean, http400ResponseError: boolean, capiQuotaExceededError: boolean }}
96 */
97function detectErrors(logContent) {
98 return {
99 inferenceAccessError: INFERENCE_ACCESS_ERROR_PATTERN.test(logContent),
100 mcpPolicyError: MCP_POLICY_BLOCKED_PATTERN.test(logContent),
101 agenticEngineTimeout: AGENTIC_ENGINE_TIMEOUT_PATTERN.test(logContent),
102 modelNotSupportedError: MODEL_NOT_SUPPORTED_PATTERN.test(logContent),
103 http400ResponseError: HTTP_400_RESPONSE_ERROR_PATTERN.test(logContent),
104 capiQuotaExceededError: isCAPIQuotaExceededError(logContent),
105 };
106}
107
108/**
109 * Write GitHub Actions outputs to $GITHUB_OUTPUT.

Callers 2

mainFunction · 0.85

Calls 1

isCAPIQuotaExceededErrorFunction · 0.85

Tested by

no test coverage detected