MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / handleResponse

Method handleResponse

internal/cli/client.go:1591–1599  ·  view source on GitHub ↗
(resp *http.Response, result interface{})

Source from the content-addressed store, hash-verified

1589}
1590
1591func (c *Client) handleResponse(resp *http.Response, result interface{}) error {
1592 if resp.StatusCode >= 400 {
1593 return c.parseError(resp)
1594 }
1595 if result != nil {
1596 return json.NewDecoder(resp.Body).Decode(result)
1597 }
1598 return nil
1599}
1600
1601func (c *Client) parseError(resp *http.Response) error {
1602 var errResp struct {

Callers 7

BootstrapWithTokenMethod · 0.95
UploadAttachmentMethod · 0.95
getMethod · 0.95
postMethod · 0.95
patchMethod · 0.95

Calls 2

parseErrorMethod · 0.95
DecodeMethod · 0.65

Tested by

no test coverage detected