{"record":{"id":"d59aac93447359d9","repo":"micro/go-micro","slug":"a2a-s-s-d","errorCode":null,"errorMessage":"a2a %s: %s (%d)","messagePattern":"a2a (.+?): (.+?) \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gateway/a2a/client.go","lineNumber":263,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := c.http.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tvar out struct {\n\t\tResult json.RawMessage `json:\"result\"`\n\t\tError  *rpcError       `json:\"error\"`\n\t}\n\tif err := json.NewDecoder(resp.Body).Decode(&out); err != nil {\n\t\treturn nil, err\n\t}\n\tif out.Error != nil {\n\t\treturn nil, fmt.Errorf(\"a2a %s: %s (%d)\", method, out.Error.Message, out.Error.Code)\n\t}\n\treturn out.Result, nil\n}\n\nfunc terminal(state string) bool {\n\tswitch state {\n\tcase \"completed\", \"failed\", \"canceled\", \"rejected\", \"input-required\":\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc artifactsText(arts []Artifact) string {\n\tvar parts []Part\n\tfor _, a := range arts {\n\t\tparts = append(parts, a.Parts...)\n\t}\n\treturn textOf(parts)","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/micro/go-micro/blob/24529f140421a11a33b6999ab7944f2021cfd69c/gateway/a2a/client.go#L245-L281","documentation":"call is the generic JSON-RPC invoker used by SendMessage, SetPushNotificationConfig, and PushNotificationConfig. The library throws this error when the HTTP response decodes successfully but carries a non-null JSON-RPC error object, formatting it as 'a2a <method>: <message> (<code>)'. It distinguishes application-level rejections from transport failures.","triggerScenarios":"Any of the call-based methods (SendMessage, SetPushNotificationConfig, PushNotificationConfig) receives a JSON-RPC error frame: method not found, invalid params (malformed Message/Part or push config), task not found, or unauthorized.","commonSituations":"Agent implements an older A2A spec lacking a method the client calls; Message Parts use a kind the agent rejects; push notification config references an unknown task; API key/credential invalid at the agent.","solutions":["Map the JSON-RPC code: -32601 method not found (spec/agent version mismatch), -32602 invalid params (fix payload), task-not-found codes (re-send or poll), auth codes (fix credentials).","Compare your client and agent A2A protocol versions; upgrade the client or pin the agent to a compatible version.","Validate Message Parts and push notification config fields before sending.","Retry only for transient server-side codes; do not retry invalid-param or not-found errors."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"result, err := c.SendMessage(ctx, msg)\nif err != nil {\n\tif m := rpcRe.FindStringSubmatch(err.Error()); m != nil {\n\t\tmethod, message, code := m[1], m[2], m[3]\n\t\tswitch code {\n\t\tcase \"-32601\": // method not found: version mismatch\n\t\tcase \"-32602\": // invalid params: fix payload\n\t\t}\n\t}\n\treturn err\n}","preventionTips":["Validate Message Parts and push config payloads before sending","Match client protocol version to the agent's advertised capabilities","Do not retry invalid-param or not-found codes; retry only transient 5xx-class codes","Keep credentials current for auth-coded errors"],"tags":["a2a","json-rpc","api"],"backgroundTag":"json-rpc-error-response","analyzedSha":"24529f140421a11a33b6999ab7944f2021cfd69c","analyzedAt":"2026-09-01T02:52:24.923Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}