jackwener/OpenCLI · warning · EmptyResultError

dongchedi search "${keyword}": No car series matched. Try th

Error message

dongchedi search "${keyword}": No car series matched. Try the model name, e.g. "宝马X5" or "汉兰达".

What it means

An EmptyResultError thrown by the dongchedi search command (clis/dongchedi/search.js:76). The command fetched the SSR page for `/search?keyword=...`, parsed the car-series result rows from `searchData`, and found zero rows. The library throws this instead of returning an empty result so callers get an explicit, typed signal that the keyword did not match any car series on Dongchedi.

Source

Thrown at clis/dongchedi/search.js:76

    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'keyword', required: true, positional: true, help: '搜索关键词,例如 "宝马X5" 或 "汉兰达"' },
        { name: 'limit', type: 'int', default: 15, help: '返回的车系数量(最多 30)' },
    ],
    columns: SEARCH_COLUMNS,
    func: async (args) => {
        const keyword = String(args.keyword || '').trim();
        if (!keyword) throw new ArgumentError('keyword', 'must be a non-empty string');
        const limit = requireLimit(args.limit, 15, 30);

        const pp = await dcdFetchPageProps(
            `/search?keyword=${encodeURIComponent(keyword)}`,
            `search "${keyword}"`,
        );
        const rows = parseSearchRows(pp.searchData, limit);
        if (rows.length === 0) {
            throw new EmptyResultError(
                `dongchedi search "${keyword}"`,
                'No car series matched. Try the model name, e.g. "宝马X5" or "汉兰达".',
            );
        }
        return rows;
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry with the Chinese model name, e.g. "宝马X5" or "汉兰达", since Dongchedi indexes series by their Chinese names.
  2. Check the keyword for typos, extra whitespace, or brand-only terms and use a specific series name instead.
  3. Search the web for the model's official Chinese market name and use that exact string.
  4. Catch EmptyResultError in the caller and treat it as 'no matches' rather than a crash, then prompt for a better keyword.

Example fix

// before
await dcd.search("BMW X5"); // EmptyResultError
// after
await dcd.search("宝马X5"); // matches the series
Defensive patterns

Strategy: try-catch

Validate before calling

function isLikelySeriesKeyword(kw) {
  const k = String(kw || '').trim();
  return k.length >= 2 && /[\u4e00-\u9fff]/.test(k); // prefer non-empty Chinese model names
}

Try / catch

import { EmptyResultError } from '@jackwener/opencli/errors';
try {
  const rows = await dcdSearch(keyword);
} catch (err) {
  if (err instanceof EmptyResultError) {
    console.log(`No series matched "${keyword}"; try the Chinese model name.`);
  } else throw err;
}

Prevention

When it happens

Trigger: Running the dongchedi search command with a keyword that matches no car series: a misspelled or transliterated model name, an English name when the site indexes Chinese names (e.g. "BMW X5" instead of "宝马X5"), a brand-only keyword, or a keyword that only matches articles/videos rather than car series.

Common situations: Developers hard-coding English model names, scripts feeding raw user input (typos, extra spaces, partial names) into search, or scraping after Dongchedi renamed/reindexed a series so a previously working keyword no longer resolves.

Related errors


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