Attempts to construct an ErrorResponseBody out of a failed server request.
Assumes that the response has already been checked to be not ok. This
function consumes the body of the response, and assumes that it hasn't
been consumed before.
The code is forgiving, and constructs a useful synthetic body as best it can
if the response body wasn't on the expected form.
Attempts to construct an ErrorResponseBody out of a failed server request. Assumes that the response has already been checked to be not ok. This function consumes the body of the response, and assumes that it hasn't been consumed before.
The code is forgiving, and constructs a useful synthetic body as best it can if the response body wasn't on the expected form.