Reads a response body, classifying a read failure with a service error origin.
The requester (requestWithRetry/request) classifies only the fetch and
the response status; it returns the Response before the body is
consumed. Reading the body stream can fail after a successful response —
e.g. the connection drops mid-body — rejecting with a bare TypeError
("Failed to fetch") that carries no origin and would otherwise be reported
with ReportableError's internal default. This reads the body on the
caller's behalf and rethrows such failures as a ReportableError with a
service origin (mirroring RequestError origin classification: a 5xx
status is serviceExternal, anything else serviceInternal). An aborted read
is preserved as a silent error so an intentional cancellation is not reported.
Reads a response body, classifying a read failure with a service error origin.
The requester (requestWithRetry/request) classifies only the fetch and
the response status; it returns the Response before the body is
consumed. Reading the body stream can fail after a successful response —
e.g. the connection drops mid-body — rejecting with a bare TypeError
("Failed to fetch") that carries no origin and would otherwise be reported
with ReportableError's internal default. This reads the body on the
caller's behalf and rethrows such failures as a ReportableError with a
service origin (mirroring RequestError origin classification: a 5xx
status is serviceExternal, anything else serviceInternal). An aborted read
is preserved as a silent error so an intentional cancellation is not reported.
Reads a response body, classifying a read failure with a service error origin.
The requester (
requestWithRetry/request) classifies only thefetchand the response status; it returns the Response before the body is consumed. Reading the body stream can fail after a successful response — e.g. the connection drops mid-body — rejecting with a bareTypeError("Failed to fetch") that carries no origin and would otherwise be reported with ReportableError'sinternaldefault. This reads the body on the caller's behalf and rethrows such failures as a ReportableError with a service origin (mirroring RequestError origin classification: a 5xx status isserviceExternal, anything elseserviceInternal). An aborted read is preserved as a silent error so an intentional cancellation is not reported.