jackwener/OpenCLI · warning · EmptyResultError
pinterest search-users
Error message
pinterest search-users
What it means
EmptyResultError from pinterest search-users: the user search page returned no user rows for the keyword. The command throws rather than returning an empty list, making 'no users matched' an explicit, catchable outcome.
Solutions
- Try a shorter or alternate spelling of the name/keyword
- Check the users tab on pinterest.com in a browser to confirm whether user results exist at all
- Catch EmptyResultError and fall back to search-pins or search-boards for the same keyword
Example fix
// before
const users = await pinterest.searchUsers({ query: 'veryobscurename12345' }); // throws
// after
try {
return await pinterest.searchUsers({ query: 'anna' });
} catch (e) {
if (e.name === 'EmptyResultError') return { users: [], note: 'no matches' };
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
if (typeof query !== 'string' || !query.trim()) throw new Error('pre-check: query required'); Try / catch
try { users = await pinterest.searchUsers({ query }); }
catch (e) {
if (e.name === 'EmptyResultError') return fallbackToPinSearch(query);
throw e;
} Prevention
- Use short name fragments — user search matches loosely
- Confirm the users tab has results in a browser for your region before scripting
- Implement a fallback path (pins/boards search) when user search is empty
When it happens
Trigger: A valid keyword where /search/users/ renders zero creator rows within the limit — obscure or misspelled names, a locale where the search has no user matches, or a page the extractor cannot parse.
Common situations: Searching real names with unusual spellings, Pinterest's user-search being deprioritized in some regions (users tab empty even when pins exist), or stale selectors after a Pinterest UI change.
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/b13ebc53fd7963f6.
Report an issue: GitHub.
Appendix: source
Thrown at clis/pinterest/search-users.js:49
baseOptions: { query, scope: 'users' },
sourceUrl,
limit,
keyField: 'username',
pageSize: DEFAULT_PAGE_SIZE,
mapItem: (user) => {
if (!user || user.type !== 'user' || !user.username) return null;
return {
username: user.username,
fullName: (user.full_name || '').trim(),
followerCount: typeof user.follower_count === 'number' ? user.follower_count : 0,
pinCount: typeof user.pin_count === 'number' ? user.pin_count : 0,
url: `${PINTEREST_BASE}/${user.username}/`,
};
},
});
if (rows.length === 0) {
throw new EmptyResultError('pinterest search-users', `no users found for "${query}"`);
}
return rows;
},
});
View on GitHub (pinned to 49907e53dc)