MCPcopy Create free account
hub / github.com/Effect-TS/effect / reasonToJSON

Function reasonToJSON

packages/effect/src/http/HttpClientError.ts:193–197  ·  view source on GitHub ↗
(reason: HttpClientErrorReason, json: unknown)

Source from the content-addressed store, hash-verified

191// message, so headers, URL parameters and bodies stay out of logs. The full
192// objects remain available through the `request` and `response` properties.
193const reasonToJSON = (reason: HttpClientErrorReason, json: unknown) => ({
194 ...(json as object),
195 request: { _id: "HttpClientRequest", method: reason.request.method, url: redactedUrl(reason) },
196 ...("response" in reason ? { response: { _id: "HttpClientResponse", status: reason.response.status } } : undefined)
197})
198
199/**
200 * Error describing transport-level failures that occur while sending an HTTP request.

Callers 6

toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85

Calls 1

redactedUrlFunction · 0.85

Tested by

no test coverage detected