{"record":{"id":"727f7f17ad97ac6f","repo":"jackwener/OpenCLI","slug":"no-flight-hotel-packages-for-origin-name-to-d","errorCode":null,"errorMessage":"No flight+hotel packages for ${origin.name} to ${dest.name} on ${depart} .. ${ret}","messagePattern":"No flight\\+hotel packages for (.+?) to (.+?) on (.+?) \\.\\. (.+?)","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/trip/package.js","lineNumber":82,"sourceCode":"        }\n        const dest = await resolvePackageCity(to);\n        if (!dest) {\n            throw new ArgumentError(`Could not resolve destination \"${to}\" to a Trip.com city; run 'trip search ${to}' to find the name`);\n        }\n        if (origin.cityId === dest.cityId) {\n            throw new ArgumentError(`--from and --to must differ (both resolved to ${dest.name})`);\n        }\n\n        const groups = await fetchPackageSearch({\n            dcode: origin.cityCode,\n            acode: dest.cityCode,\n            hcityid: String(dest.cityId),\n            depart,\n            ret,\n            adults,\n        });\n        if (groups.length === 0) {\n            throw new EmptyResultError('trip package', `No flight+hotel packages for ${origin.name} to ${dest.name} on ${depart} .. ${ret}`);\n        }\n        const rows = groups\n            .filter((g) => g && Array.isArray(g.flightlist) && g.flightlist.length)\n            .map((g) => mapPackageRow(g, 0))\n            .filter((row) => row.flightNo && row.from && row.to && row.departure && row.arrival);\n        if (rows.length === 0) {\n            throw new CommandExecutionError(`Trip.com package search returned ${groups.length} group(s) but none carried a parseable flight identity, route, and time`);\n        }\n        return rows.slice(0, limit).map((row, i) => ({ ...row, rank: i + 1 }));\n    },\n});\n","sourceCodeStart":64,"sourceCodeEnd":94,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trip/package.js#L64-L94","documentation":"This EmptyResultError is thrown by the Trip.com package search when the API responds successfully but returns zero flight+hotel package groups for the requested route and dates. The library distinguishes a genuine empty result set (nothing bookable) from malformed data, so hitting this means the request itself was well-formed but Trip.com had no matching packages.","triggerScenarios":"Calling the trip package search with an origin/destination pair and depart/ret dates for which Trip.com's package inventory returns groups.length === 0 — e.g. obscure routes, far-future or past dates, or dates with sold-out inventory.","commonSituations":"Searching niche city pairs with no bundled flight+hotel deals; querying dates outside Trip.com's package inventory window; typo'd city resolving to a valid cityId with no package coverage; weekend/holiday inventory exhausted.","solutions":["Try different travel dates (shift depart/ret by a day or two) — inventory is date-sensitive.","Try a nearby or larger origin/destination city that has package coverage.","Book flight and hotel separately via the other trip.com commands instead of a package.","If the route should plausibly have packages, log the raw API response and verify the request params (cityId, dates, adults) are correct."],"exampleFix":"// before\nconst rows = await tripPackage({ origin, dest, depart: '2026-01-01', ret: '2026-01-02' });\n// after\ntry {\n  const rows = await tripPackage({ origin, dest, depart: '2026-01-05', ret: '2026-01-08' });\n} catch (e) {\n  if (e.name === 'EmptyResultError') return []; // no packages for this route/date\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"if (!origin?.cityId || !dest?.cityId) throw new Error('origin and dest must resolve to cityIds');\nif (!depart || !ret) throw new Error('depart and ret dates are required');","typeGuard":"function hasCityId(c) { return c != null && typeof c.cityId !== 'undefined' && typeof c.name === 'string'; }","tryCatchPattern":"try {\n  const rows = await packageSearch({ origin, dest, depart, ret });\n} catch (e) {\n  if (e instanceof EmptyResultError) return [];\n  throw e;\n}","preventionTips":["Prefer major city pairs with known package inventory.","Validate dates are in the future and within a bookable window.","Catch EmptyResultError explicitly and degrade gracefully (separate flight+hotel booking).","Log empty routes to detect systematically uncovered markets."],"tags":["empty-result","travel-api","trip-com"],"backgroundTag":"empty-search-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}