{"record":{"id":"64abf2c8622438aa","repo":"jackwener/OpenCLI","slug":"no-hotels-rendered-totaltext-try-a-broader-d","errorCode":null,"errorMessage":"No hotels rendered (${totalText}). Try a broader destination, different dates, or check the URL in a browser.","messagePattern":"No hotels rendered \\((.+?)\\)\\. Try a broader destination, different dates, or check the URL in a browser\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/booking/search.js","lineNumber":302,"sourceCode":"      throw new CommandExecutionError('Booking.com served a verification / captcha page; retry later or change profile');\n    }\n\n    if (raw.ok !== true) {\n      throw new CommandExecutionError('Booking.com extractor returned an invalid status');\n    }\n    if (!Array.isArray(raw.items)) {\n      throw new CommandExecutionError('Booking.com extractor returned malformed items');\n    }\n\n    const items = raw.items;\n    if (items.length === 0) {\n      const totalText = String(raw.totalText || '').trim();\n      if (hasPositiveResultCount(totalText)) {\n        throw new CommandExecutionError(\n          `Booking.com page declared results but no property cards were parsed: ${totalText}`,\n        );\n      }\n      throw new EmptyResultError(\n        `booking search ${JSON.stringify(destination)}`,\n        totalText\n          ? `No hotels rendered (${totalText}). Try a broader destination, different dates, or check the URL in a browser.`\n          : 'No hotels rendered. Try a broader destination, different dates, or check the URL in a browser.',\n      );\n    }\n\n    return items.slice(0, limit).map((it, i) => {\n      if (!it || typeof it !== 'object') {\n        throw new CommandExecutionError('Booking.com extractor returned malformed hotel row');\n      }\n      const name = String(it.name || '').trim();\n      const country = String(it.country || '').trim();\n      const slug = String(it.slug || '').trim();\n      const urlValue = String(it.url || '').trim();\n      const expectedUrl = country && slug\n        ? `https://www.booking.com/hotel/${country}/${slug}.html`\n        : '';","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/booking/search.js#L284-L320","documentation":"This EmptyResultError is thrown when the extractor parsed zero property cards AND the page's result-count text shows no positive result count (or is empty). It is the library's way of saying 'the search legitimately returned nothing to show', wrapping the totalText as detail plus advice to broaden the query. Unlike error 527, this is not a parsing failure — the page itself had no hotel cards.","triggerScenarios":"items.length === 0 and hasPositiveResultCount(totalText) is false — e.g. totalText is '0 properties found' or empty because Booking.com rendered no results for the query.","commonSituations":"Very narrow/misspelled destination; dates far in the future or in the past; filters implicit in the URL excluding everything; tiny villages with no listed properties; currency/lang parameters producing a locale with no inventory.","solutions":["Broaden the destination (city/region instead of a specific address or landmark).","Try different or nearer-term checkin/checkout dates.","Open the generated URL in a browser to verify the query itself yields results.","Check spelling and use a well-known place name for the destination.","Relax any additional filters and retry with default currency/language parameters."],"exampleFix":"// before\nawait search({ destination: 'Rue de la PAix 12, Paris', checkin: '2026-05-10', checkout: '2026-05-11' });\n// after\nawait search({ destination: 'Paris', checkin: '2026-05-10', checkout: '2026-05-11' });","handlingStrategy":"fallback","validationCode":"function looksLikeRealPlace(dest) {\n  const d = String(dest || '').trim();\n  return d.length >= 3 && !/^\\d+$/.test(d); // crude sanity check on destination\n}\nif (!looksLikeRealPlace(destination)) console.warn('destination may yield zero results; consider broadening');","typeGuard":null,"tryCatchPattern":"try {\n  return await booking.search(params);\n} catch (e) {\n  if (e instanceof EmptyResultError || /No hotels rendered/.test(e.message)) {\n    return booking.search({ ...params, destination: broadenDestination(params.destination) });\n  }\n  throw e;\n}","preventionTips":["Use city/region-level destination names rather than exact addresses.","Sanity-check dates (not in the past, not absurdly far out).","Handle EmptyResultError as an expected outcome, not a crash.","Preview the generated URL in a browser when a query repeatedly returns nothing."],"tags":["empty-results","search","user-input"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}