{"record":{"id":"bcaf0602e50c815d","repo":"jackwener/OpenCLI","slug":"weibo-user-posts","errorCode":null,"errorMessage":"weibo user-posts","messagePattern":"weibo user-posts","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/weibo/user-posts.js","lineNumber":216,"sourceCode":"      })()\n    `);\n\n        const payload = unwrapEvaluateResult(evaluateResult);\n        if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {\n            mapError(payload.error);\n        }\n        if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {\n            throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');\n        }\n        const [resolvedUid, rows, sawList, sawPostCandidates] = payload;\n        if (!sawList && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');\n        }\n        if (sawPostCandidates && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');\n        }\n        if (rows.length === 0) {\n            throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');\n        }\n\n        return rows.slice(0, limit).map((row, index) => ({\n            rank: index + 1,\n            id: String(row.id),\n            mblogid: row.mblogid || '',\n            author: row.author || '',\n            uid: String(row.uid || resolvedUid || ''),\n            text: row.text || '',\n            time: row.time || '',\n            reposts: row.reposts ?? 0,\n            comments: row.comments ?? 0,\n            likes: row.likes ?? 0,\n            pic_count: row.pic_count ?? 0,\n            url: row.url || '',\n        }));\n    },\n});","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/user-posts.js#L198-L234","documentation":"This is the well-formed empty case: the payload is valid, a posts list was observed and no post candidates were seen, but zero valid rows were extracted. The CLI throws EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range') to signal the user simply has no posts matching the query, e.g. no posts within the requested start/end window.","triggerScenarios":"Querying a user who posted nothing in the given date range, a range entirely before the account's first post or after its last, an overly restrictive limit/filter, or a user whose posts are all hidden/deleted.","commonSituations":"Narrow date windows around inactive periods, querying archived/suspended accounts, or time-zone off-by-one where the Shanghai date window excludes expected posts.","solutions":["Widen the start/end date range and retry.","Confirm the account actually posted in the window by checking the profile in a browser.","Verify the uid corresponds to the intended account (similar numeric ids are easy to mistype).","Remember dates are interpreted in Asia/Shanghai (+08:00); shift your range if you computed boundaries in another time zone."],"exampleFix":"// before\n--start 2024-03-01 --end 2024-03-02   // no posts in window\n// after\n--start 2024-01-01 --end 2024-03-31   // widened window","handlingStrategy":"fallback","validationCode":"if (start && end && start > end) throw new Error('inverted range');\nif (start && end && (Date.parse(end) - Date.parse(start)) / 86400000 > 366) {\n  console.warn('range exceeds one year; consider chunking');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await runUserPosts(opts);\n} catch (err) {\n  if (err instanceof EmptyResultError) {\n    return []; // treat as legitimate 'no posts in range'\n  }\n  throw err;\n}","preventionTips":["Treat EmptyResultError as expected data emptiness, not a bug.","Verify the uid maps to the intended account.","Remember dates are Asia/Shanghai (+08:00) — shift ranges computed in UTC/local time.","Widen date windows for low-activity accounts."],"tags":["empty-result","weibo","date-range"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}