client.tap((r) =>
r.headers.get("Content-Type").value?.startsWith("application/json")
? Effect.unit
: Effect.fail<HttpClientError>(HttpClientError.ResponseError({
// request exists within ClientResponse as a private field
request: (r as any).request,
response: r,
reason: "Decode",
error: "not json response: " + r.headers.get("Content-Type").value
}))
)
client.tap((r) =>
r.headers.get("Content-Type").value?.startsWith("application/json")
? Effect.unit
: Effect.fail<HttpClientError>(HttpClientError.ResponseError({
// request exists within ClientResponse as a private field
request: (r as any).request,
response: r,
reason: "Decode",
error: "not json response: " + r.headers.get("Content-Type").value
}))
)