jackwener/OpenCLI · warning · EmptyResultError

No map-pool rows found for team

Error message

No map-pool rows found for team ${teamId}/${slug}

What it means

After a successful parse, team-map-pool throws this EmptyResultError when the parsed row array is empty, meaning HLTV returned no map-pool statistics for the given team. The team exists but has no map records in the analyzed pool/window.

Solutions

  1. Verify teamId and slug refer to the same, active team on HLTV
  2. Confirm the team's HLTV page shows map statistics manually
  3. Try a different/active team to validate the call path
  4. Catch EmptyResultError and report 'no map-pool data for this team'

Example fix

// before
await teamMapPool(page, { teamId: 12345, slug: 'wrong-slug' });
// after
await teamMapPool(page, { teamId: 12345, slug: 'correct-slug' }); // id and slug from the same team page
Defensive patterns

Strategy: try-catch

Validate before calling

// confirm the team page has map stats before invoking
const teamUrl = `https://www.hltv.org/team/${teamId}/${slug}`;
// fetch teamUrl and ensure the stats/maps section exists

Type guard

function isTeamRef(t) { return Number.isFinite(t?.teamId) && typeof t?.slug === 'string' && t.slug.length > 0; }

Try / catch

try {
  const pool = await teamMapPool(page, { teamId, slug });
} catch (err) {
  if (err instanceof EmptyResultError) return { rows: [], note: 'no map-pool data for this team' };
  throw err;
}

Prevention

When it happens

Trigger: Calling with a teamId/slug of a team with no recorded map stats (new, inactive, or academy team); team page exists but the maps section is empty; wrong teamId/slug combo resolving to a page without map-pool data.

Common situations: Querying a newly formed roster with no official maps; dead/inactive team pages; mixing a teamId from one team with a slug from another so the page has no data; regional teams with sparse HLTV coverage.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/1c523189069c32ec. Report an issue: GitHub.

Appendix: source

Thrown at clis/hltv/team-map-pool.js:92

          category: 'map',
          key: mapName,
          teamId: payload.teamId,
          team,
          record,
          winRate,
          totalRounds,
          firstKillWinPct,
          firstDeathWinPct,
          pickPct,
          banPct,
          mapUrl: byMap.get(mapName)?.mapUrl ?? null,
        });
      }
      return [...byMap.values()];
    }, { base: BASE, teamId, slug });

    if (!Array.isArray(rawRows)) throw new CommandExecutionError('hltv team-map-pool parser returned an unexpected shape');
    if (rawRows.length === 0) throw new EmptyResultError('hltv team-map-pool', `No map-pool rows found for team ${teamId}/${slug}`);

    const rows = rawRows.map((row) => {
      const record = splitRecord(row.record);
      const maps = record.wins === null ? null : (record.wins ?? 0) + (record.draws ?? 0) + (record.losses ?? 0);
      return {
        category: row.category,
        key: row.key,
        teamId: row.teamId,
        team: row.team,
        maps,
        winMaps: record.wins,
        lossMaps: record.losses,
        winRatePct: parseNumber(row.winRate),
        avgRoundDiff: null,
        details: {
          draws: record.draws,
          totalRounds: parseNumber(row.totalRounds),
          roundsPerMap: maps ? round(parseNumber(row.totalRounds) / maps) : null,

View on GitHub (pinned to 49907e53dc)