private function verifyResources(array $resources, bool $force = false): array {
        $passed = array();
        foreach ($resources as $key => $res) {
            try {
                $res->getMetadata($force);
                $passed[$key] = $res;
            } catch (ClientException $e) {
                // "410 gone" means the resource was deleted during current transaction
                if ($e->getCode() !== 410) {
                    throw $e;
                } else {
                    $this->cache->delete($res);
                }
            }
        }
        return $passed;
    }