{"record":{"id":"a351fe1a2dfec465","repo":"jackwener/OpenCLI","slug":"nothing-to-update","errorCode":null,"errorMessage":"nothing to update","messagePattern":"nothing to update","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/board-update.js","lineNumber":32,"sourceCode":"  strategy: Strategy.COOKIE,\n  args: [\n    { name: 'board', type: 'string', positional: true, required: true, help: '<username>/<slug>, a board URL, or a numeric board id, e.g. janedoe/my-board' },\n    { name: 'name', type: 'string', default: '', help: 'New board name' },\n    { name: 'description', type: 'string', help: 'New board description (pass \"\" to clear)' },\n    { name: 'privacy', type: 'string', choices: PRIVACY, help: 'New privacy: public or secret' },\n  ],\n  columns: ['boardId', 'name', 'privacy', 'url'],\n  func: async (page, kwargs) => {\n    const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, kwargs.board);\n    const name = String(kwargs.name ?? '').trim();\n    const description = kwargs.description === undefined ? undefined : String(kwargs.description).trim();\n    const privacy = String(kwargs.privacy ?? '').trim();\n\n    if (privacy && !PRIVACY.includes(privacy)) {\n      throw new ArgumentError(`Unknown privacy \"${privacy}\". Valid: ${PRIVACY.join(', ')}`);\n    }\n    if (!name && description === undefined && !privacy) {\n      throw new ArgumentError(\n        'nothing to update',\n        'Pass at least one of --name, --description, or --privacy',\n      );\n    }\n\n    await page.goto(`${PINTEREST_BASE}${path}`);\n    const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);\n\n    const options = { board_id: boardId };\n    if (name) options.name = name;\n    if (description !== undefined) options.description = description;\n    if (privacy) options.privacy = privacy;\n\n    const updated = await pinterestResourceUpdate(page, 'BoardResource', options, path);\n\n    return [{\n      boardId,\n      name: (updated && updated.name) || name,","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/board-update.js#L14-L50","documentation":"The board-update command requires at least one of --name, --description, or --privacy to be provided. If all are absent (or empty after trimming), it raises ArgumentError('nothing to update') with the hint 'Pass at least one of --name, --description, or --privacy' before touching the page.","triggerScenarios":"Calling `pinterest board-update <board>` with no field flags, or where the supplied values are empty/whitespace strings that get trimmed to nothing (e.g. --name \"\").","commonSituations":"Templated scripts where variables expand to empty strings; copy-pasted commands missing flags; wrappers that forward kwargs but drop falsy values.","solutions":["Pass at least one of --name, --description, or --privacy with a non-empty value.","Check that shell variables feeding the flags are non-empty.","Skip the command entirely when no changes are needed instead of calling it with no fields.","Guard in your wrapper: build the kwargs object and only invoke when Object.keys(kwargs).length > 0."],"exampleFix":"// before\nawait cli.boardUpdate('user/board', { name: '' });\n// after\nawait cli.boardUpdate('user/board', { name: 'New board name' });","handlingStrategy":"validation","validationCode":"const updates = {};\nif (name) updates.name = name;\nif (description) updates.description = description;\nif (privacy) updates.privacy = privacy;\nif (Object.keys(updates).length === 0) return; // nothing to do, skip the call","typeGuard":"function hasUpdate(u) {\n  return Boolean(u && (u.name?.trim() || u.description?.trim() || u.privacy?.trim()));\n}","tryCatchPattern":"try {\n  await cli.boardUpdate(board, updates);\n} catch (e) {\n  if (/nothing to update/.test(e.message)) console.warn('skipped: no fields given');\n  else throw e;\n}","preventionTips":["Always pass at least one non-empty field","Guard against empty shell variables feeding flags","Build kwargs objects dynamically and skip empty calls","Remember trimmed whitespace-only values count as empty"],"tags":["pinterest","invalid-argument","missing-parameter","cli"],"backgroundTag":"missing-required-parameter","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}