jackwener/OpenCLI · error · CommandExecutionError

Trip.com bounced ${city} / ${airport} to the transfer landin

Error message

Trip.com bounced ${city} / ${airport} to the transfer landing; check the city name matches the airport IATA code

What it means

CommandExecutionError thrown when Trip.com redirected the transfer search back to the generic airport-transfers landing page instead of a specific airport results page. The URL path regex /\/airport-transfers\/[^/]+\/airport-[^/]+/ fails, so the library concludes the city/airport combination did not resolve.

Source

Thrown at clis/trip/transfer.js:63

        const city = parseKeyword('city', kwargs.city);
        const airport = parseIataCode('airport', kwargs.airport);
        const limit = parseListLimit(kwargs.limit);

        const listUrl = buildTransferListUrl(city, airport);
        await page.goto(listUrl);
        const waitResult = await page.evaluate(WAIT_FOR_TRANSFERS_JS);
        if (waitResult === 'captcha') {
            throw new AuthRequiredError('trip.com', 'Trip.com is asking for a verification; complete it in your browser session and retry');
        }
        if (waitResult === 'empty') {
            throw new EmptyResultError('trip transfer', `No airport transfers for ${city} (${airport})`);
        }
        if (waitResult !== 'content') {
            throw new CommandExecutionError(`Trip.com transfer listing did not render (state=${String(waitResult)}); check the city and airport code`);
        }
        const landedPath = await page.evaluate('location.pathname');
        if (!/\/airport-transfers\/[^/]+\/airport-[^/]+/i.test(String(landedPath))) {
            throw new CommandExecutionError(`Trip.com bounced ${city} / ${airport} to the transfer landing; check the city name matches the airport IATA code`);
        }
        const raw = await page.evaluate(buildTransferExtractJs());
        if (!Array.isArray(raw)) {
            throw new CommandExecutionError('Trip.com transfer DOM extraction returned malformed rows');
        }
        if (raw.length === 0) {
            throw new CommandExecutionError('Trip.com transfer cards rendered but parser did not find required price anchors');
        }
        return raw.slice(0, limit).map((r, i) => ({
            rank: i + 1,
            type: r.type,
            passengers: r.passengers,
            luggage: r.luggage,
            price: r.price,
            currency: r.currency,
            url: listUrl,
        }));
    },

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the city name matches the airport IATA code you passed
  2. Check Trip.com's URL scheme — if they redesigned paths, update the regex in the source
  3. Test the URL manually in a browser to see where Trip.com redirects
  4. Correct the airport code (e.g. Paris -> CDG/ORY, not LHR)

Example fix

// before
await getTransfers({ city: 'Paris', airport: 'LHR' }); // mismatch -> bounce
// after
await getTransfers({ city: 'London', airport: 'LHR' });
Defensive patterns

Strategy: validation

Validate before calling

// ensure city and airport actually correspond
const cityByIata = { LHR:'London', LGW:'London', CDG:'Paris', ORY:'Paris', JFK:'New York' };
if (cityByIata[airport] && cityByIata[airport].toLowerCase() !== city.toLowerCase()) {
  throw new Error(`airport ${airport} does not match city ${city}`);
}

Type guard

null

Try / catch

try {
  const rows = await getTransfers(args);
} catch (e) {
  if (e.message.includes('bounced')) {
    console.error(`Check: does ${airport} belong to ${city}?`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Passing an airport IATA code that does not match the city (e.g. city 'Paris' with airport 'LHR'), a nonexistent airport code, or a city name Trip.com cannot map, causing a bounce to the landing/search page.

Common situations: Mismatched city–airport pairs when users copy codes from a different city; outdated airport codes; typos like 'LDN' instead of 'LON' city slugs; Trip.com changing its URL scheme so the regex no longer matches a valid result page.

Related errors


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