jackwener/OpenCLI · warning · EmptyResultError

pinterest user-pins

Error message

pinterest user-pins

What it means

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.

Source

Thrown at clis/pinterest/user-pins.js:37

  ],
  columns: ['pinId', 'title', 'description', 'pinner', 'board', 'imageUrl', 'url'],
  func: async (page, kwargs) => {
    const username = parseUsername(kwargs.username);
    const limit = requireLimit(kwargs.limit, { fallback: DEFAULT_LIMIT, max: MAX_LIMIT });

    const sourceUrl = `/${username}/`;
    await page.goto(`${PINTEREST_BASE}${sourceUrl}`);

    const rows = await collectPins(page, {
      resource: 'UserPinsResource',
      baseOptions: { username, field_set_key: 'grid_item' },
      sourceUrl,
      limit,
      pageSize: DEFAULT_PAGE_SIZE,
    });

    if (rows.length === 0) {
      throw new EmptyResultError('pinterest user-pins', `no pins found for user "${username}"`);
    }
    return rows;
  },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Confirm in a browser that the profile actually shows public pins
  2. Increase --limit or retry later if Pinterest rendered an empty grid transiently
  3. Catch EmptyResultError and treat it as an empty pin list in your pipeline

Example fix

// before
const pins = await pinterest.userPins({ username: 'brandaccount' }); // throws
// after
let pins = [];
try { pins = await pinterest.userPins({ username: 'brandaccount' }); }
catch (e) { if (e.name !== 'EmptyResultError') throw e; }
Defensive patterns

Strategy: try-catch

Validate before calling

if (!/^[A-Za-z0-9_]{3,}$/.test(username)) throw new Error('pre-check: username looks invalid');

Try / catch

let pins = [];
try { pins = await pinterest.userPins({ username }); }
catch (e) { if (e.name !== 'EmptyResultError') throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: Fresh accounts with no activity, users who deleted their pins, suspended accounts whose profiles still resolve, and rate-limited scrapes returning blank grids.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/4fe4c235857f16d2. Report an issue: GitHub.