{"record":{"id":"47a1b406a7be0e19","repo":"jackwener/OpenCLI","slug":"message-47a1b4","errorCode":null,"errorMessage":"message","messagePattern":"message","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weibo/user-posts.js","lineNumber":70,"sourceCode":"function dateToTimestamp(date) {\n    return Math.floor(new Date(`${date}T00:00:00+08:00`).getTime() / 1000);\n}\n\nfunction validateRange(start, end) {\n    if (start && end && dateToTimestamp(start) > dateToTimestamp(end)) {\n        throw new ArgumentError('weibo user-posts start must be <= end');\n    }\n}\n\nfunction mapError(error) {\n    const message = String(error ?? '').trim();\n    if (!message) {\n        throw new CommandExecutionError('weibo user-posts failed without an error message');\n    }\n    if (/login|cookie|登录|auth|forbidden|permission|权限|unauthorized/i.test(message)) {\n        throw new AuthRequiredError('weibo.com', message);\n    }\n    throw new CommandExecutionError(message);\n}\n\nexport const testInternals = {\n    readRequiredId,\n    readLimit,\n    readDate,\n    dateToTimestamp,\n};\n\ncli({\n    site: 'weibo',\n    name: 'user-posts',\n    access: 'read',\n    description: 'List Weibo posts from a user, optionally filtered by date range',\n    domain: 'weibo.com',\n    strategy: Strategy.COOKIE,\n    args: [\n        { name: 'id', positional: true, required: true, help: 'User ID (numeric uid) or screen name' },","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/user-posts.js#L52-L88","documentation":"If the underlying error message is non-empty and does not match the auth keyword pattern, mapError() wraps it verbatim in a CommandExecutionError. Error [4465] with message 'message' corresponds to this generic wrap: the thrown error text is the raw underlying message passed through as-is.","triggerScenarios":"Any extraction failure whose text lacks login/cookie/auth/forbidden/permission/unauthorized keywords — e.g. timeouts, selector misses, navigation errors — reaches mapError and is rethrown as CommandExecutionError(message).","commonSituations":"Weibo DOM changes breaking the page-side extractor, slow page loads timing out, transient network failures, or anti-scraping interstitials.","solutions":["Read the wrapped message for the real cause and address that underlying problem.","Retry the command; transient network/loading failures often succeed on a second run.","Check whether the Weibo page structure changed, which would break extraction selectors.","Ensure the page can fully load (stable network, no aggressive proxy blocking weibo assets)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"function isCommandExecutionError(e) {\n  return e && e.name === 'CommandExecutionError';\n}","tryCatchPattern":"try {\n  return await runUserPosts(opts);\n} catch (err) {\n  if (err instanceof CommandExecutionError && !/auth|login/i.test(err.message)) {\n    await sleep(3000);\n    return runUserPosts(opts); // single retry for transient failures\n  }\n  throw err;\n}","preventionTips":["Use a reliable, unrestricted network path to weibo.com.","Rate-limit requests to avoid anti-scraping interstitials.","Keep the CLI updated against Weibo DOM changes.","Log the full error message to identify the underlying cause."],"tags":["command-execution","weibo","extraction"],"backgroundTag":"command-execution-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}