{"record":{"id":"b74bc620f87162cd","repo":"jackwener/OpenCLI","slug":"section-requires-board","errorCode":null,"errorMessage":"--section requires --board","messagePattern":"--section requires --board","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/pin-update.js","lineNumber":40,"sourceCode":"    { 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;\n      sourceUrl = path;\n    } else {\n      await page.goto(`${PINTEREST_BASE}${sourceUrl}`);\n    }\n\n    if (title) options.title = title;","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/pin-update.js#L22-L58","documentation":"Thrown in clis/pinterest/pin-update.js:40 when --section is provided without --board. Board sections always belong to a specific board, so the command cannot resolve a section id without knowing the target board, and it fails fast before any API call.","triggerScenarios":"`pin-update <id> --section <name-or-id>` with no --board argument, so `section` is truthy while `boardRef` is empty.","commonSituations":"Assuming the pin's current board is inferred automatically; copying a section-only command from docs; scripts that conditionally pass --board but always pass --section.","solutions":["Add --board to the same command: `pin-update <id> --board <user>/<slug> --section <section>`","If you only want the section and the pin already lives on the right board, still pass that board's reference explicitly","If you didn't mean to move sections, remove the stray --section flag"],"exampleFix":"// before\n$ opencli pinterest pin-update 1234567890 --section recipes\n// after\n$ opencli pinterest pin-update 1234567890 --board me/cooking --section recipes","handlingStrategy":"validation","validationCode":"if (section && !board) {\n  throw new Error('--section requires --board: sections belong to a board');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await run(['pin-update', pinId, '--board', board, '--section', section]);\n} catch (e) {\n  if (/--section requires --board/.test(e.message)) {\n    throw new Error('Pass the parent board with --board alongside --section');\n  }\n  throw e;\n}","preventionTips":["Always pass --board and --section as a pair in scripts/templates","Remember sections are board-scoped — never assume the pin's current board is implied","Keep board+section together in wrapper configs to avoid partial forwarding"],"tags":["validation","argument-error","pinterest","dependent-flags"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}