{"record":{"id":"3fe3f4cb772b9a3a","repo":"jackwener/OpenCLI","slug":"empty-result-3fe3f4","errorCode":"EMPTY_RESULT","errorMessage":"该用户没有公开笔记（可能销号 / 私密 / 全部删除）。","messagePattern":"该用户没有公开笔记（可能销号 / 私密 / 全部删除）。","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/xiaohongshu/user.js","lineNumber":136,"sourceCode":"        for (let i = 0; results.length < limit && i < 4; i += 1) {\n            await page.autoScroll({ times: 1, delayMs: 1500 });\n            await page.wait(1);\n            snapshot = await readUserSnapshot(page);\n            if (isLoginWallSnapshot(snapshot)) {\n                throwLoginWallAuthRequired();\n            }\n            assertReadableUserSnapshot(snapshot);\n            const nextResults = extractXhsUserNotes(snapshot ?? {}, userId);\n            if (nextResults.length <= previousCount)\n                break;\n            results = nextResults;\n            previousCount = nextResults.length;\n        }\n        if (results.length === 0) {\n            // 与 bilibili subtitle 同模式：作者无公开内容是合法 empty 数据条件\n            // （销号 / 私密号 / 全删笔记），不是 fetch 失败。下游应识别 code\n            // EMPTY_RESULT 跳过 rate-limit 启发式、不计入 softFail 阈值。\n            throw new EmptyResultError('xiaohongshu user', '该用户没有公开笔记（可能销号 / 私密 / 全部删除）。');\n        }\n        return results.slice(0, limit);\n    },\n});\n","sourceCodeStart":118,"sourceCodeEnd":141,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaohongshu/user.js#L118-L141","documentation":"After scrolling/paginating the user's notes, zero notes were collected, so the command throws EmptyResultError with code EMPTY_RESULT. Per the source comment, an author with no public notes (deactivated account, private account, or all notes deleted) is a legitimate empty-data condition, not a fetch failure — downstream consumers should recognize the code and skip rate-limit heuristics and softFail counting.","triggerScenarios":"Target user deactivated (销号) their account; account is fully private; user deleted all public notes; or the notes never hydrated across all retry rounds (previousCount stayed 0).","commonSituations":"Crawling a user URL that was deleted; stale bookmark to a removed account; scraping profiles where notes require login that this session lacks.","solutions":["Treat code EMPTY_RESULT as a skip, not a failure: check err.code === 'EMPTY_RESULT' in your handler and continue","Verify the user's profile in a browser to confirm the account is really empty/private rather than blocked","If you expected notes, check whether login is required to see them and refresh the session","Catch EmptyResultError separately from CommandExecutionError in your pipeline"],"exampleFix":"// before\ntry { notes = await userCommand.run({ userId }); }\ncatch (err) { console.error(err); }\n// after\ntry { notes = await userCommand.run({ userId }); }\ncatch (err) {\n  if (err.code === 'EMPTY_RESULT') { skipUser(userId); return; }\n  throw err;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const notes = await getUserNotes(userId);\n} catch (err) {\n  if (err.code === 'EMPTY_RESULT') {\n    return []; // legitimate empty: deactivated/private/deleted account — do not count as failure\n  }\n  throw err;\n}","preventionTips":["Check err.code === 'EMPTY_RESULT' explicitly so empty authors don't burn softFail/rate-limit budget","Verify target user URLs are still live before batch runs","Exclude known-private/deleted accounts from crawl lists"],"tags":["empty-result","xiaohongshu","data-availability"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}