{"record":{"id":"2e80b00d7a0db039","repo":"jackwener/OpenCLI","slug":"action-action","errorCode":null,"errorMessage":"未知的 action: ${action}","messagePattern":"未知的 action: (.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/douyin/hashtag.js","lineNumber":118,"sourceCode":"            if (allSentences !== undefined && allSentences !== null && !Array.isArray(allSentences)) {\n                throw new CommandExecutionError('douyin hashtag hot: API returned malformed \"all_sentences\"');\n            }\n            const items = Array.isArray(hotspotList)\n                ? hotspotList\n                : Array.isArray(allSentences)\n                    ? allSentences.map(h => ({\n                        sentence: h?.word ?? '',\n                        hot_value: h?.hot_value,\n                        sentence_id: h?.sentence_id ?? '',\n                    }))\n                    : [];\n            return items.slice(0, kwargs.limit).map(h => ({\n                name: h?.sentence ?? '',\n                id: h && 'sentence_id' in h ? h.sentence_id : '',\n                view_count: h?.hot_value ?? 0,\n            }));\n        }\n        throw new ArgumentError(`未知的 action: ${action}`);\n    },\n});\n","sourceCodeStart":100,"sourceCodeEnd":121,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/douyin/hashtag.js#L100-L121","documentation":"ArgumentError thrown by the douyin hashtag command when the action argument is not one of the supported values (search/suggest/hot). The command dispatches on action and this is the terminal else branch.","triggerScenarios":"Invoking the hashtag command with any action string other than the registered ones, e.g. a typo like `hashtag serach` or `hashtag trending` (clis/douyin/hashtag.js:118).","commonSituations":"Typos in CLI usage; scripts written against an imagined action name; docs from an older/newer version listing different actions.","solutions":["Use a supported action: search, suggest, or hot.","Run the command with --help to list valid actions.","Fix the action name in your script/alias."],"exampleFix":"// before\nopencli douyin hashtag trending --keyword foo\n// after\nopencli douyin hashtag hot --keyword foo","handlingStrategy":"validation","validationCode":"const VALID_ACTIONS = ['search', 'suggest', 'hot'];\nif (!VALID_ACTIONS.includes(action)) {\n  throw new Error(`invalid action \"${action}\"; expected one of ${VALID_ACTIONS.join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await hashtag({ action, ...rest });\n} catch (e) {\n  if (String(e.message).startsWith('未知的 action')) {\n    console.error(`\"${action}\" is not valid; use search | suggest | hot`);\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Validate action names in wrapper scripts before invoking the CLI.","Use --help to discover supported actions instead of guessing.","Centralize action names as constants in automation code."],"tags":["cli","argument-validation","usage"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}