{"record":{"id":"4fe4c235857f16d2","repo":"jackwener/OpenCLI","slug":"pinterest-user-pins","errorCode":null,"errorMessage":"pinterest user-pins","messagePattern":"pinterest user-pins","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/pinterest/user-pins.js","lineNumber":37,"sourceCode":"  ],\n  columns: ['pinId', 'title', 'description', 'pinner', 'board', 'imageUrl', 'url'],\n  func: async (page, kwargs) => {\n    const username = parseUsername(kwargs.username);\n    const limit = requireLimit(kwargs.limit, { fallback: DEFAULT_LIMIT, max: MAX_LIMIT });\n\n    const sourceUrl = `/${username}/`;\n    await page.goto(`${PINTEREST_BASE}${sourceUrl}`);\n\n    const rows = await collectPins(page, {\n      resource: 'UserPinsResource',\n      baseOptions: { username, field_set_key: 'grid_item' },\n      sourceUrl,\n      limit,\n      pageSize: DEFAULT_PAGE_SIZE,\n    });\n\n    if (rows.length === 0) {\n      throw new EmptyResultError('pinterest user-pins', `no pins found for user \"${username}\"`);\n    }\n    return rows;\n  },\n});\n","sourceCodeStart":19,"sourceCodeEnd":42,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/user-pins.js#L19-L42","documentation":"EmptyResultError from pinterest user-pins: the profile scrape yielded zero pin rows for the username. As with the other pinterest commands, an empty result set is raised as an error so callers never confuse 'no pins' with a failed or skipped run.","triggerScenarios":"collectResults over the user's pins returns no rows within limit/pageSize: account has no public pins, profile is private/suspended, username is misspelled, or extraction fails against the page markup.","commonSituations":"Fresh accounts with no activity, users who deleted their pins, suspended accounts whose profiles still resolve, and rate-limited scrapes returning blank grids.","solutions":["Confirm in a browser that the profile actually shows public pins","Increase --limit or retry later if Pinterest rendered an empty grid transiently","Catch EmptyResultError and treat it as an empty pin list in your pipeline"],"exampleFix":"// before\nconst pins = await pinterest.userPins({ username: 'brandaccount' }); // throws\n// after\nlet pins = [];\ntry { pins = await pinterest.userPins({ username: 'brandaccount' }); }\ncatch (e) { if (e.name !== 'EmptyResultError') throw e; }","handlingStrategy":"try-catch","validationCode":"if (!/^[A-Za-z0-9_]{3,}$/.test(username)) throw new Error('pre-check: username looks invalid');","typeGuard":null,"tryCatchPattern":"let pins = [];\ntry { pins = await pinterest.userPins({ username }); }\ncatch (e) { if (e.name !== 'EmptyResultError') throw e; }","preventionTips":["Expect empty pins for new or private accounts and handle it as a valid state","Add a delay/backoff before concluding an account truly has no pins","Cache known-good usernames to avoid scraping stale handles"],"tags":["empty-results","scraping","user-profile"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}