{"record":{"id":"12638655a5620c21","repo":"jackwener/OpenCLI","slug":"description-too-long-description-length-chars","errorCode":null,"errorMessage":"Description too long: ${description.length} chars (max ${DESCRIPTION_MAX})","messagePattern":"Description too long: (.+?) chars \\(max (.+?)\\)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/twitter/list-create.js","lineNumber":32,"sourceCode":"    responsive_web_profile_redirect_enabled: false,\n    rweb_tipjar_consumption_enabled: false,\n    verified_phone_label_enabled: false,\n    responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,\n    responsive_web_graphql_timeline_navigation_enabled: true,\n};\n\nexport function parseListCreateArgs(kwargs) {\n    const name = String(kwargs.name || '').trim();\n    const description = String(kwargs.description || '').trim();\n    const modeRaw = String(kwargs.mode || 'public').trim().toLowerCase();\n    if (!name) {\n        throw new ArgumentError('List name is required', 'Example: opencli twitter list-create \"My List\"');\n    }\n    if (name.length > NAME_MAX) {\n        throw new ArgumentError(`List name too long: ${name.length} chars (max ${NAME_MAX})`);\n    }\n    if (description.length > DESCRIPTION_MAX) {\n        throw new ArgumentError(`Description too long: ${description.length} chars (max ${DESCRIPTION_MAX})`);\n    }\n    if (modeRaw !== 'public' && modeRaw !== 'private') {\n        throw new ArgumentError(`Invalid mode: ${JSON.stringify(kwargs.mode)}. Expected \"public\" or \"private\".`);\n    }\n    return { listName: name, listDescription: description, listMode: modeRaw, privateFlag: modeRaw === 'private' };\n}\n\nfunction requireCreateListResult(result, expectedName, expectedMode) {\n    if (!result || typeof result !== 'object') {\n        throw new CommandExecutionError(`Unexpected result from twitter list-create: ${JSON.stringify(result)}`);\n    }\n    if (result.httpStatus === 401 || result.httpStatus === 403) {\n        throw new AuthRequiredError('x.com', `Twitter CreateList returned HTTP ${result.httpStatus}`);\n    }\n    if (!result.ok) {\n        const snippet = String(result.bodyText || '').slice(0, 300);\n        throw new CommandExecutionError(`HTTP ${result.httpStatus} from CreateList: ${snippet}`);\n    }","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/twitter/list-create.js#L14-L50","documentation":"This ArgumentError is thrown by parseListCreateArgs when the --description value exceeds DESCRIPTION_MAX = 100 characters (after trimming). Twitter/X caps list descriptions at 100 chars, so the CLI rejects it up front rather than letting the API fail. The message reports the actual and maximum lengths.","triggerScenarios":"Calling `opencli twitter list-create \"Name\" --description \"...\"` with a description string longer than 100 characters after trimming.","commonSituations":"Pasting a paragraph as the list description; generating descriptions programmatically from templates that exceed 100 chars; confusion with other platforms' larger bio/description limits.","solutions":["Trim the description to 100 characters or fewer","Check length before calling: description.trim().length <= 100","Omit --description entirely (defaults to empty string) and edit it later"],"exampleFix":"// before\nconst description = \"A curated list of accounts covering AI research, industry news, policy analysis, open source, and community events worldwide.\"; // 128 chars\n// after\nconst description = \"A curated list of accounts covering AI research, industry news, policy analysis, and open source.\"; // 98 chars","handlingStrategy":"validation","validationCode":"const description = String(descArg || '').trim();\nif (description.length > 100) {\n  throw new Error(`Description must be <= 100 chars (got ${description.length})`);\n}","typeGuard":"function isValidListDescription(desc) {\n  return desc == null || (typeof desc === 'string' && desc.trim().length <= 100);\n}","tryCatchPattern":"try {\n  await opencli.twitter.listCreate({ name, description, mode });\n} catch (e) {\n  if (e instanceof ArgumentError && /Description too long/.test(e.message)) {\n    console.error('Shorten the description to <= 100 characters.');\n  } else { throw e; }\n}","preventionTips":["Truncate or validate descriptions before passing --description","Keep templates for descriptions within the 100-char budget","Remember trimming happens first: whitespace padding doesn't count against the limit"],"tags":["argument-validation","input-length","twitter"],"backgroundTag":"input-validation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}