MCPcopy Create free account
hub / github.com/compozy/agh / readAPIError

Function readAPIError

internal/cli/client.go:6286–6292  ·  view source on GitHub ↗
(response *http.Response)

Source from the content-addressed store, hash-verified

6284}
6285
6286func readAPIError(response *http.Response) error {
6287 body, err := io.ReadAll(io.LimitReader(response.Body, 1<<20))
6288 if err != nil {
6289 return fmt.Errorf("cli: read api error response: %w", err)
6290 }
6291 return readAPIErrorBody(response.StatusCode, response.Status, body)
6292}
6293
6294func readAPIErrorBody(statusCode int, status string, body []byte) error {
6295 var payload struct {

Callers 7

DownloadSupportBundleMethod · 0.85
ResolveBridgeTargetMethod · 0.85
AgentTaskClaimNextMethod · 0.85
decodeJSONResponseMethod · 0.85
doSSEMethod · 0.85
doSessionPromptMethod · 0.85

Calls 1

readAPIErrorBodyFunction · 0.85

Tested by 1