private function throwException(\Exception $e, BatchContext $context) { if ($context->throwsExceptions() || $e instanceof RequestException && $e->getThrowImmediately()) { $context->removeAll(); $this->releaseMultiHandle($context->getMultiHandle()); throw $e; } }