MCPcopy Create free account
hub / github.com/anus-dev/ANUS / parseResponseData

Function parseResponseData

packages/core/src/utils/errors.ts:63–69  ·  view source on GitHub ↗
(error: GaxiosError)

Source from the content-addressed store, hash-verified

61}
62
63function parseResponseData(error: GaxiosError): ResponseData {
64 // Inexplicably, Gaxios sometimes doesn't JSONify the response data.
65 if (typeof error.response?.data === 'string') {
66 return JSON.parse(error.response?.data) as ResponseData;
67 }
68 return error.response?.data as ResponseData;
69}

Callers 1

toFriendlyErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected