{"record":{"id":"c5ed89c431040860","repo":"jackwener/OpenCLI","slug":"no-board-with-id-trimmed","errorCode":null,"errorMessage":"No board with id \"${trimmed}\"","messagePattern":"No board with id \"(.+?)\"","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/utils.js","lineNumber":303,"sourceCode":"  if (direct) return { ...direct, board: null };\n\n  if (!/^\\d+$/.test(trimmed)) {\n    throw new ArgumentError(\n      `Not a board reference: \"${trimmed}\"`,\n      'Expected <username>/<slug>, a board URL, or a numeric board id (from `board-pins`/`user-boards`)',\n    );\n  }\n\n  await page.goto(`${PINTEREST_BASE}/`);\n  const { data: board } = await pinterestResourceFetch(\n    page,\n    'BoardResource',\n    { board_id: trimmed, field_set_key: 'detailed' },\n    '/',\n  );\n  const url = board && board.url;\n  if (!url) {\n    throw new ArgumentError(`No board with id \"${trimmed}\"`, 'Check the id with `opencli pinterest user-boards <username>`');\n  }\n  const parts = decodeSegment(url).split('/').filter(Boolean);\n  if (parts.length < 2) {\n    throw new CommandExecutionError(`Board ${trimmed} returned an unusable url: ${url}`);\n  }\n  // Hand the fetched board back so callers do not re-request what we already have.\n  return { username: parts[0], slug: parts[1], path: `/${parts[0]}/${parts[1]}/`, board };\n}\n\n/**\n * Resolve a --section value against the board's real sections, accepting an id or a slug.\n * Pinterest ignores an unknown section silently, so an unmatched value must fail here.\n * Returns { sectionId, title, slug }.\n */\nexport async function resolveSection(page, boardId, sectionValue, sourceUrl) {\n  const wanted = String(sectionValue ?? '').trim();\n  const { results } = await pinterestResourceFetch(page, 'BoardSectionsResource', { board_id: String(boardId) }, sourceUrl);\n  const sections = results.filter((section) => section && section.id);","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/utils.js#L285-L321","documentation":"resolveBoardTarget resolves a board argument to {username, slug, path}. When the raw value is a numeric board id, it fetches the board via Pinterest's BoardResource (field_set_key=detailed). If the response contains no `url` for that board id, it throws this ArgumentError — Pinterest returned no board (deleted, private, or wrong id).","triggerScenarios":"Calling any command with `--board <numeric-id>` where the id does not resolve: board was deleted, board belongs to another/secret account, id typo, or the BoardResource API returns an empty object for that board_id.","commonSituations":"Reusing a board id copied days ago from `board-pins`/`user-boards` output after the board was deleted or renamed-and-recreated; script hardcoding a board id from a different account; Pinterest returning sparse data for secret boards.","solutions":["List valid board ids with `opencli pinterest user-boards <username>` and use one of those ids.","Pass the board as `<username>/<slug>` or a full pinterest.com board URL instead of a numeric id.","Verify the board still exists and is accessible to the logged-in Pinterest session in a browser.","Check for typos / whitespace in the id argument."],"exampleFix":"// before\n--board 5123456789012345\n// after\n--board someuser/recipe-ideas","handlingStrategy":"validation","validationCode":"const boardArg = String(process.argv.board ?? '').trim();\nif (/^\\d+$/.test(boardArg) && !knownBoardIds.has(boardArg)) {\n  throw new Error(`Board id ${boardArg} not in cached user-boards list — run 'opencli pinterest user-boards <username>' first`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCmd(['opencli', 'pinterest', 'pin-create', '--board', boardId, ...]);\n} catch (err) {\n  if (String(err.message).includes('No board with id')) {\n    // fall back to listing boards and re-resolving\n    const boards = await listUserBoards(username);\n    // pick fresh id and retry\n  } else throw err;\n}","preventionTips":["Cache the output of `user-boards` and validate ids against it before scripting.","Prefer `<username>/<slug>` references over raw numeric ids in scripts.","Re-fetch board ids after any manual board deletion/rename."],"tags":["pinterest","not-found","argument","board"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}