{"record":{"id":"a1a8d9f638aa33f3","repo":"jackwener/OpenCLI","slug":"not-found-a1a8d9","errorCode":"NOT_FOUND","errorMessage":"NOT_FOUND","messagePattern":"NOT_FOUND","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"warning","filePath":"clis/weibo/search.js","lineNumber":73,"sourceCode":"            url.match(/^https?:\\\\/\\\\/(?:www\\\\.)?weibo\\\\.com\\\\/(?:detail|status)\\\\/([A-Za-z0-9]+)(?:[?#/]|$)/);\n\n          const title = clean(contentEl && contentEl.textContent);\n          if (!title) continue;\n\n          rows.push({\n            id: idMatch ? idMatch[1] : '',\n            title,\n            author: clean(authorEl && authorEl.textContent),\n            time: clean(timeEl && timeEl.textContent),\n            url,\n          });\n        }\n\n        return rows;\n      })()\n    `)), 'weibo search');\n        if (data.length === 0) {\n            throw new CliError('NOT_FOUND', 'No Weibo search results found', 'Try a different keyword or ensure you are logged into weibo.com');\n        }\n        return data.slice(0, limit).map((item, index) => ({\n            rank: index + 1,\n            ...item,\n        }));\n    },\n});\n","sourceCodeStart":55,"sourceCodeEnd":81,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/search.js#L55-L81","documentation":"CliError with code NOT_FOUND thrown when the in-page Weibo search scrape returns zero rows. The CLI evaluates a search-results extractor on weibo.com, unwraps it with the 'weibo search' tag, and treats an empty array as 'nothing found' rather than returning an empty list.","triggerScenarios":"Calling `weibo search <keyword>` where the scraped data array is empty — the search page rendered no result cards (or the extractor failed to match the current DOM and produced no rows).","commonSituations":"Obscure keyword with no Weibo results; not logged in so Weibo shows a login wall instead of results; Weibo changed search-results markup so the extractor matches nothing (looks like 'no results'); typo'd or over-filtered keyword.","solutions":["Try a different, more common keyword to test whether search works at all","Verify you are logged into weibo.com in the browser session","Check weibo.com search manually for the keyword — if results exist there but not here, update the CLI for the new DOM structure","Retry later if Weibo is rate-limiting or showing a captcha"],"exampleFix":"// before\nconst rows = await search(keyword);\n// after\nconst rows = await search(keyword);\nif (!rows.length) throw new CliError('NOT_FOUND', 'No Weibo search results found', 'Try a different keyword or ensure you are logged into weibo.com');","handlingStrategy":"try-catch","validationCode":"if (!keyword || !keyword.trim()) {\n    throw new Error('Keyword is required for weibo search');\n}","typeGuard":null,"tryCatchPattern":"try {\n    const results = await weiboSearch(keyword);\n} catch (err) {\n    if (err.code === 'NOT_FOUND') {\n        console.warn(`No results for \"${keyword}\"; try a broader term or verify login.`);\n        results = [];\n    } else throw err;\n}","preventionTips":["Check err.code === 'NOT_FOUND' specifically rather than message text","Verify login state before searching","Test with a common keyword first to distinguish 'no results' from 'broken extractor'","Handle empty results gracefully in downstream code"],"tags":["empty-results","weibo","search","not-found"],"backgroundTag":"no-search-results","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}