{"record":{"id":"60d64ffc8746a191","repo":"jackwener/OpenCLI","slug":"no-tour-packages-for-destination","errorCode":null,"errorMessage":"No tour packages for \"${destination}\"","messagePattern":"No tour packages for \"(.+?)\"","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/ctrip/tour.js","lineNumber":50,"sourceCode":"    columns: [\n        'rank',\n        'title', 'subtitle',\n        'tags', 'score', 'sold', 'reviews',\n        'price',\n        'url',\n    ],\n    func: async (page, kwargs) => {\n        const destination = parsePlaceName('destination', kwargs.destination);\n        const limit = parseListLimit(kwargs.limit);\n\n        const searchUrl = buildTourListUrl(destination);\n        await page.goto(searchUrl);\n        const waitResult = await page.evaluate(WAIT_FOR_VACATIONS_JS);\n        if (waitResult === 'captcha') {\n            throw new AuthRequiredError('vacations.ctrip.com', 'Ctrip is asking for a captcha; complete it in your browser session and retry');\n        }\n        if (waitResult === 'empty') {\n            throw new EmptyResultError('ctrip tour', `No tour packages for \"${destination}\"`);\n        }\n        if (waitResult !== 'content') {\n            throw new CommandExecutionError(`Ctrip tour page did not render package cards (state=${String(waitResult)})`);\n        }\n        const raw = await page.evaluate(buildVacationsExtractJs());\n        if (!Array.isArray(raw)) {\n            throw new CommandExecutionError('Ctrip tour DOM extraction returned malformed rows');\n        }\n        if (raw.length === 0) {\n            throw new CommandExecutionError('Ctrip tour cards rendered but parser did not find required package anchors');\n        }\n        return raw.slice(0, limit).map((r, i) => ({\n            rank: i + 1,\n            title: r.title,\n            subtitle: r.subtitle,\n            tags: r.tags,\n            score: r.score,\n            sold: r.sold,","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/ctrip/tour.js#L32-L68","documentation":"An EmptyResultError raised by `ctrip tour` when the vacations.ctrip.com tour search page explicitly reports an empty result state (WAIT_FOR_VACATIONS_JS returned 'empty'), meaning no tour packages match the destination keyword. Unlike the render-failure errors, this means the page loaded fine and genuinely has no matching tour lines.","triggerScenarios":"Running `opencli ctrip tour <destination>` where Ctrip's tour search returns zero .list_product_item cards for that keyword — obscure destinations, misspelled names, or destinations Ctrip does not sell tour packages for.","commonSituations":"Searching tiny towns or non-tourist locations; romanized/English spellings Ctrip does not index; destinations only served by the package (机+酒) tab but not the tour tab; typo'd Chinese characters.","solutions":["Retry with a major tourist destination keyword such as 北京, 三亚, or 马尔代夫","Use the destination's official Chinese name","If you expected tours, try the `ctrip package` command (flight+hotel tab) instead","Catch EmptyResultError and try alternative keywords in your script"],"exampleFix":"// before\nconst tours = await runCli('ctrip', 'tour', destination);\n// after\nlet tours;\ntry {\n  tours = await runCli('ctrip', 'tour', destination);\n} catch (e) {\n  if (e.name === 'EmptyResultError') tours = await runCli('ctrip', 'package', destination);\n  else throw e;\n}","handlingStrategy":"fallback","validationCode":"const q = String(dest || '').trim();\nif (q.length < 2) console.warn('short/obscure keywords often yield no tour results');","typeGuard":null,"tryCatchPattern":"try {\n  const tours = await runCli('ctrip', 'tour', dest);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    tours = await runCli('ctrip', 'package', dest); // try flight+hotel tab\n  } else throw e;\n}","preventionTips":["Use major tourist destination keywords in Chinese","Fall back to the `ctrip package` command when tours are empty","Verify the destination exists on ctrip.com in a browser","Treat EmptyResultError as expected behavior for niche destinations"],"tags":["empty-result","search","scraping","ctrip"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}