{"record":{"id":"695a172b2582e160","repo":"jackwener/OpenCLI","slug":"bilibili-comment-replies-parent","errorCode":null,"errorMessage":"bilibili comment replies: ${parent}","messagePattern":"bilibili comment replies: (.+?)","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/bilibili/comments.js","lineNumber":156,"sourceCode":"            throw new CommandExecutionError(`Cannot resolve aid for bvid: ${bvid}`);\n        const payload = parent != null\n            ? await apiGet(page, '/x/v2/reply/reply', {\n                params: { oid: aid, type: 1, root: parent, pn: 1, ps: limit },\n            })\n            : await apiGet(page, '/x/v2/reply/main', {\n                params: { oid: aid, type: 1, mode: 3, ps: top ? 1 : limit },\n                signed: true,\n            });\n        const label = parent != null ? 'reply thread' : 'reply main';\n        const data = requireOkPayload(payload, label);\n        const replies = top\n            ? requireTopReplies(data, label)\n            : requireReplies(data, label);\n        if (replies.length === 0) {\n            if (top) {\n                throw new EmptyResultError(`bilibili pinned comments: ${bvid}`);\n            }\n            throw new EmptyResultError(parent != null ? `bilibili comment replies: ${parent}` : `bilibili comments: ${bvid}`);\n        }\n        return replies.slice(0, limit).map(formatReplyRow);\n    },\n});\n","sourceCodeStart":138,"sourceCodeEnd":161,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/bilibili/comments.js#L138-L161","documentation":"An EmptyResultError thrown when querying with --parent <rpid>: the /x/v2/reply/reply endpoint returned zero nested replies, meaning the given parent comment has no sub-replies (楼中楼).","triggerScenarios":"Running 'bilibili comments <bvid> --parent <rpid>' where the parent comment's reply list is empty (replies: [] or null), typically because the root comment has no replies or the rpid points at a comment whose replies were removed.","commonSituations":"Reusing an rpid captured earlier after its replies were deleted; passing a valid but reply-less comment ID; pagination stopping at page 1 of an empty thread.","solutions":["Verify the rpid belongs to a comment that actually has replies (check the replies column of the top-level listing)","Omit --parent to browse top-level comments instead","Treat this EmptyResultError as a benign 'no replies' outcome in automation","Re-fetch top-level comments to confirm the rpid is still valid"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const parentRow = topRows.find((r) => String(r.rpid) === String(parent));\nif (parentRow && Number(parentRow.replies) === 0) {\n    console.warn('parent comment has no nested replies; skipping --parent query');\n}","typeGuard":"function hasReplies(row) {\n    return !!row && Number(row.replies) > 0;\n}","tryCatchPattern":"try {\n    const nested = await bilibiliComments(bvid, { parent });\n} catch (err) {\n    if (err instanceof EmptyResultError || /comment replies/.test(err.message)) {\n        // treat as zero replies, not a failure\n    } else throw err;\n}","preventionTips":["Check the parent comment's replies count before issuing --parent","Treat empty nested threads as a normal outcome","Re-fetch top-level comments if the rpid came from an old snapshot","Skip reply-less comments proactively in batch scripts"],"tags":["bilibili","empty-result","nested-replies"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}