{"record":{"id":"584c7fdb2b7d1fac","repo":"jackwener/OpenCLI","slug":"nothing-to-update-584c7f","errorCode":null,"errorMessage":"nothing to update","messagePattern":"nothing to update","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/pin-update.js","lineNumber":34,"sourceCode":"    // No default: an omitted flag stays undefined, so `--description \"\"` can clear the field.\n    { name: 'description', type: 'string', help: 'New pin description (pass \"\" to clear)' },\n    // Pinterest refuses link edits on scraped pins (\"你沒有變更此連結的權限\"), so this only\n    // works on pins whose link you own.\n    { name: 'link', type: 'string', help: 'New destination link (pass \"\" to clear)' },\n    { name: 'board', type: 'string', default: '', help: 'Move the pin to this board: <username>/<slug>, board URL, or board id' },\n    { name: 'section', type: 'string', default: '', help: 'Move the pin to this board section id or slug (requires --board)' },\n  ],\n  columns: ['pinId', 'title', 'board', 'url'],\n  func: async (page, kwargs) => {\n    const id = parsePinId(kwargs.pin);\n    const title = String(kwargs.title ?? '').trim();\n    const description = kwargs.description === undefined ? undefined : String(kwargs.description).trim();\n    const link = kwargs.link === undefined ? undefined : String(kwargs.link).trim();\n    const boardRef = String(kwargs.board ?? '').trim();\n    const section = String(kwargs.section ?? '').trim();\n\n    if (!title && description === undefined && link === undefined && !boardRef) {\n      throw new ArgumentError(\n        'nothing to update',\n        'Pass at least one of --title, --description, --link, or --board',\n      );\n    }\n    if (section && !boardRef) {\n      throw new ArgumentError('--section requires --board', 'Sections belong to a board, so pass --board too');\n    }\n\n    const options = { id };\n    let sourceUrl = `/pin/${id}/`;\n\n    if (boardRef) {\n      const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, boardRef);\n      await page.goto(`${PINTEREST_BASE}${path}`);\n      const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);\n      options.board_id = boardId;\n      // PinResource/update is the only endpoint that honours a section, and only under this key.\n      if (section) options.board_section_id = (await resolveSection(page, boardId, section, path)).sectionId;","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/pin-update.js#L16-L52","documentation":"Thrown in clis/pinterest/pin-update.js:34 when a pin-update invocation supplies no updatable field: title is empty, description/link are undefined, and no --board is given. The command refuses to issue a no-op API call, and the remediation hint lists the accepted fields.","triggerScenarios":"Calling `pin-update <id>` with none of --title, --description, --link, --board; or passing values that trim to empty strings (e.g. --title \"  \") so the guard `!title && description === undefined && link === undefined && !boardRef` is true.","commonSituations":"Script templates with all field placeholders left empty; whitespace-only argument values; a wrapper that strips undefined/empty kwargs before forwarding, leaving nothing to update; typos in flag names (e.g. --titel) so the intended field never reaches kwargs.","solutions":["Pass at least one of --title, --description, --link, or --board","Check flag spelling — a mistyped flag (e.g. --tittle) is silently ignored and triggers this error","Avoid whitespace-only values; pass real content or omit the flag entirely","If you only meant to inspect the pin, use the `pin` get command instead of pin-update"],"exampleFix":"// before\n$ opencli pinterest pin-update 1234567890\n// ArgumentError: nothing to update\n// after\n$ opencli pinterest pin-update 1234567890 --title \"New title\"","handlingStrategy":"validation","validationCode":"const fields = { title, description, link, board };\nif (Object.values(fields).every(v => v === undefined || String(v).trim() === '')) {\n  throw new Error('pin-update needs at least one of --title, --description, --link, --board');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await run(['pin-update', pinId, ...fieldArgs]);\n} catch (e) {\n  if (/nothing to update/.test(e.message)) {\n    throw new Error('No updatable fields were provided — check flag names and values');\n  }\n  throw e;\n}","preventionTips":["Build update commands programmatically from a fields object so at least one is always set","Check flag spelling — mistyped flags are silently dropped, leaving nothing to update","Trim values beforehand and omit flags whose content is empty","Use pin (read) instead of pin-update when you only need to inspect"],"tags":["validation","argument-error","no-op","pinterest"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}