{"record":{"id":"2c620cad3e7b6bdc","repo":"jackwener/OpenCLI","slug":"repin-did-not-return-a-pin-id","errorCode":null,"errorMessage":"Repin did not return a pin id","messagePattern":"Repin did not return a pin id","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/save.js","lineNumber":48,"sourceCode":"\n    if (boardRef) {\n      const { username, slug, path, board } = await resolveBoardTarget(page, boardRef);\n      await page.goto(`${PINTEREST_BASE}${path}`);\n\n      const { boardId } = await resolveBoardId(page, username, slug, path, board);\n      options.board_id = boardId;\n      sourceUrl = path;\n      // Validate --section before repinning, so a bad value fails before anything is created.\n      if (section) sectionId = (await resolveSection(page, options.board_id, section, path)).sectionId;\n    } else {\n      // No board given: Pinterest routes a boardless repin to the profile's Quick Saves board.\n      await page.goto(`${PINTEREST_BASE}/`);\n    }\n\n    const created = await pinterestResourceCreate(page, 'RepinResource', options, sourceUrl);\n    const newId = created && created.id;\n    if (!newId) {\n      throw new CommandExecutionError('Repin did not return a pin id');\n    }\n\n    if (sectionId) {\n      await movePinToSection(page, newId, options.board_id, sectionId, sourceUrl);\n    }\n\n    return [{\n      pinId: String(newId),\n      sourcePinId,\n      board: (created.board && created.board.name) || (boardRef || 'profile'),\n      url: `${PINTEREST_BASE}/pin/${newId}/`,\n    }];\n  },\n});\n","sourceCodeStart":30,"sourceCodeEnd":63,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/save.js#L30-L63","documentation":"Thrown in clis/pinterest/save.js:48 when pinterestResourceCreate on RepinResource returns no object or an object without an id. Without a new pin id the command can't confirm the save happened nor move it to a section, so it raises instead of returning partial results.","triggerScenarios":"The RepinResource/create call responds with an empty/failed payload — expired session cookies, the source pin was deleted or private (unrepinnable), target board unavailable, rate limiting, or Pinterest API changes breaking response extraction.","commonSituations":"Repining a pin that was deleted moments earlier; saving to a board you lost access to; automated bulk saves hitting rate limits; stale cookies in long-running scripts; blocked/flagged accounts where Pinterest silently drops saves.","solutions":["Refresh session cookies / re-login, then retry the save","Verify the source pin still exists and is publicly saveable (`pin <sourcePinId>` or open its URL)","Confirm the target board is valid and writable; retry with a different board if unsure","Slow down bulk scripts (add delays) and retry later if rate-limited; check the RepinResource/create response in a browser if it persists"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure the source pin still exists before repinning\nconst src = await run(['pin', sourcePinId]).catch(() => null);\nif (!src) throw new Error(`Source pin ${sourcePinId} is gone or inaccessible`);","typeGuard":"function hasPinId(res) {\n  return res !== null && typeof res === 'object' && res.id !== undefined;\n}","tryCatchPattern":"try {\n  await run(['save', '--pin', sourcePinId, '--board', board]);\n} catch (e) {\n  if (/Repin did not return a pin id/.test(e.message)) {\n    await refreshSession();\n    return retry(() => run(['save', '--pin', sourcePinId, '--board', board]), 1);\n  }\n  throw e;\n}","preventionTips":["Check the source pin still exists before bulk saves — deleted pins yield empty create responses","Keep cookies fresh in long-running automation","Throttle bulk repins to avoid rate-limited empty replies","Confirm the target board is valid and you have write access"],"tags":["network","pinterest","api-response","session"],"backgroundTag":"empty-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}