{"record":{"id":"5840b693a0d71306","repo":"jackwener/OpenCLI","slug":"no-steam-results-matched-query","errorCode":null,"errorMessage":"No Steam results matched \"${query}\".","messagePattern":"No Steam results matched \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/steam/search.js","lineNumber":45,"sourceCode":"    description: 'Search the Steam storefront by name keyword',\n    domain: 'store.steampowered.com',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search keyword (e.g. \"portal\", \"stardew\")' },\n        { name: 'limit', type: 'int', default: 20, help: 'Max results (1-50)' },\n        { name: 'currency', default: 'us', help: 'Storefront country code (e.g. us / cn / jp / de)' },\n    ],\n    columns: ['rank', 'id', 'name', 'price', 'currency', 'metascore', 'platforms', 'url'],\n    func: async (args) => {\n        const query = requireString(args.query, 'query');\n        const limit = requireBoundedInt(args.limit, 20, 50);\n        const cc = requireCountryCode(args.currency);\n        const url = `${STEAM_STORE}/api/storesearch/?term=${encodeURIComponent(query)}&l=en&cc=${encodeURIComponent(cc)}`;\n        const body = await steamFetch(url, 'steam search');\n        const items = Array.isArray(body?.items) ? body.items : [];\n        if (!items.length) {\n            throw new EmptyResultError('steam search', `No Steam results matched \"${query}\".`);\n        }\n        return items.slice(0, limit).map((item, i) => ({\n            rank: i + 1,\n            id: String(item.id ?? ''),\n            name: decodeHtmlEntities(item.name ?? ''),\n            price: priceCents(item?.price?.final ?? null),\n            currency: String(item?.price?.currency ?? '').toUpperCase(),\n            metascore: item.metascore != null && item.metascore !== '' ? Number(item.metascore) : null,\n            platforms: platformList(item.platforms),\n            url: item.id ? `${STEAM_STORE}/app/${item.id}/` : '',\n        }));\n    },\n});\n","sourceCodeStart":27,"sourceCodeEnd":59,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/steam/search.js#L27-L59","documentation":"Steam's storesearch endpoint returned successfully but with an empty items array, so the CLI throws EmptyResultError stating no results matched the query. This is an expected empty-result path for queries Steam cannot match.","triggerScenarios":"Search term with no store matches; term in a language not used by the storefront for the given cc; overly specific multi-word queries; very short or garbled terms.","commonSituations":"Searching indie/niche titles under a regional storefront where they are not sold; misspelling game names; using localized names against an English storefront (or vice versa).","solutions":["Shorten or simplify the search term (use the base title, not the full subtitle)","Try the game's official English name or alternate spellings","Try a different currency/country code if the title may be regional","Catch EmptyResultError and prompt the user for a broader query"],"exampleFix":"// before\nconst body = await steamFetch(url, 'steam search');\nconst items = Array.isArray(body?.items) ? body.items : [];\nif (!items.length) throw new EmptyResultError('steam search', `No Steam results matched \"${query}\".`);\n// after\nif (!items.length) {\n  const retry = await steamFetch(url.replace(/term=[^&]+/, `term=${encodeURIComponent(query.split(/\\s+/)[0])}`), 'steam search');\n  ...\n}","handlingStrategy":"fallback","validationCode":"const term = String(query ?? '').trim();\nif (term.length < 2) throw new Error('search term too short');","typeGuard":"function hasSearchItems(body) {\n  return Array.isArray(body?.items) && body.items.length > 0;\n}","tryCatchPattern":"try {\n  const results = await steamSearch({ query });\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    // fall back to a shortened query or inform the user no matches exist\n  } else throw e;\n}","preventionTips":["Use the base game title without subtitles for better recall","Match the term language to the storefront country","Suggest alternate spellings to users on empty results","Catch EmptyResultError and offer query refinement rather than failing"],"tags":["steam","search","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}