private static function retryFailedRewind(callable
$handler, EasyHandle
$easy, array
$ctx): PromiseInterface
{ try { // Only rewind if the body has been read from.
$body =
$easy->request->
getBody();
if ($body->
tell() > 0
) { $body->
rewind();
} } catch (\RuntimeException
$e) { $ctx['error'
] = 'The connection unexpectedly failed without '
.'providing an error. The request would have been retried, '
.'but attempting to rewind the request body failed. '
.'Exception: '.
$e;
return self::
createRejection($easy,
$ctx);
}