{"record":{"id":"01b291e932fd16f0","repo":"jackwener/OpenCLI","slug":"refusing-to-delete-pin-row-pinid-row-title","errorCode":null,"errorMessage":"Refusing to delete pin ${row.pinId}${row.title ? ` \"${row.title}\"` : ''}${row.board ? ` from board \"${row.board}\"` : ''} without --confirm","messagePattern":"Refusing to delete pin (.+?)(.+?)\"` : ''\\}(.+?)\"` : ''\\} without --confirm","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/pin-delete.js","lineNumber":42,"sourceCode":"    const { data: pin } = await pinterestResourceFetch(\n      page,\n      'PinResource',\n      { id, field_set_key: 'detailed' },\n      sourceUrl,\n    );\n    if (!pin || !pin.id) {\n      throw new CommandExecutionError(`Could not resolve pin \"${id}\" (does it exist and do you own it?)`);\n    }\n\n    const row = {\n      pinId: String(pin.id),\n      title: (pin.title || pin.grid_title || '').trim(),\n      board: (pin.board && pin.board.name) || '',\n      deleted: false,\n    };\n\n    if (kwargs.confirm !== true) {\n      throw new ArgumentError(\n        `Refusing to delete pin ${row.pinId}${row.title ? ` \"${row.title}\"` : ''}${row.board ? ` from board \"${row.board}\"` : ''} without --confirm`,\n        'Re-run with --confirm once you are sure; deleting a pin cannot be undone',\n      );\n    }\n\n    await pinterestResourceDelete(page, 'PinResource', { id: row.pinId }, sourceUrl);\n    return [{ ...row, deleted: true }];\n  },\n});\n","sourceCodeStart":24,"sourceCodeEnd":52,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/pin-delete.js#L24-L52","documentation":"This ArgumentError is thrown in clis/pinterest/pin-delete.js:42 when a delete is attempted without kwargs.confirm === true. Deleting a pin is irreversible, so the command deliberately requires an explicit --confirm flag before calling pinterestResourceDelete, and the message includes the pin id/title/board so you know exactly what would be deleted.","triggerScenarios":"Running `pin-delete <pinId>` (or an automation/script invoking the command) without the `--confirm` flag, or with a value that isn't strictly boolean true (e.g. --confirm=false).","commonSituations":"First-time interactive use where the user forgot the flag; scheduled scripts written before the confirm requirement was added; wrappers that forward kwargs but drop boolean flags; piping commands where the confirmation arg got lost.","solutions":["Re-run the command adding the --confirm flag once you are sure: `pin-delete <pinId> --confirm`","If scripting, pass confirm: true in kwargs programmatically","If a wrapper drops the flag, fix the wrapper to forward --confirm","Double-check the pin id/title shown in the message is the pin you intend to delete — the operation cannot be undone"],"exampleFix":"// before\n$ opencli pinterest pin-delete 1234567890\n// ArgumentError: Refusing to delete pin ... without --confirm\n// after\n$ opencli pinterest pin-delete 1234567890 --confirm","handlingStrategy":"validation","validationCode":"const args = ['pin-delete', pinId];\nif (confirm !== true) throw new Error('pin-delete requires explicit confirm: true');\nargs.push('--confirm');","typeGuard":null,"tryCatchPattern":"try {\n  await run(['pin-delete', pinId, '--confirm']);\n} catch (e) {\n  if (/without --confirm/.test(e.message)) {\n    console.warn(`Confirm flag missing; delete of ${pinId} skipped`);\n  }\n  throw e;\n}","preventionTips":["Always append --confirm in scripts that intentionally delete","Check the pin id/title in the error message before confirming — deletion is irreversible","Never default confirm to true in wrappers; require an explicit opt-in","Dry-run listing (pin <id>) first to verify the target"],"tags":["confirmation","argument-error","safety-guard","destructive-operation"],"backgroundTag":"missing-confirmation-flag","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}