jackwener/OpenCLI · warning · EmptyResultError
no pins found in board "${username}/${slug}"
Error message
no pins found in board "${username}/${slug}" What it means
This EmptyResultError is thrown by the `pinterest board-pins` command when the board exists but the pin-listing API returned zero rows. The library treats an empty result as a distinct, expected outcome rather than silently returning an empty table, so callers can distinguish 'board is empty' from 'board not found'. It fires only after a successful fetch, so pagination or permission issues that return rows never reach it.
Source
Thrown at clis/pinterest/board-pins.js:53
const rows = await collectPins(page, {
resource: 'BoardFeedResource',
baseOptions: {
board_id: String(boardId),
board_url: path,
currentFilter: -1,
field_set_key: 'react_grid_pin',
filter_section_pins: true,
sort: 'default',
layout: 'default',
},
sourceUrl: path,
limit,
pageSize: DEFAULT_PAGE_SIZE,
});
if (rows.length === 0) {
throw new EmptyResultError('pinterest board-pins', `no pins found in board "${username}/${slug}"`);
}
return rows;
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Verify the board actually has pins by opening `${PINTEREST_BASE}${username}/${slug}` in a browser or via `pinterest board-sections`/board listing
- Add pins to the board or point the command at a board that contains pins
- Catch EmptyResultError in your script and treat it as an empty board (skip processing) instead of failing the pipeline
- Re-check the username/slug arguments — a wrong slug can silently resolve to a different, empty board
Example fix
// before
const pins = await cli.run('pinterest board-pins myuser/ideas');
// after
let pins;
try {
pins = await cli.run('pinterest board-pins myuser/ideas');
} catch (err) {
if (err.name === 'EmptyResultError') pins = [];
else throw err;
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!username || !slug) throw new Error('board username/slug required');
// pin count cannot be known without the API; pre-check the board resolves:
const board = await cli.run(`pinterest board-show ${username}/${slug}`); Type guard
function isEmptyResult(err) {
return err instanceof Error && err.name === 'EmptyResultError';
} Try / catch
try {
const pins = await boardPins(username, slug);
} catch (err) {
if (isEmptyResult(err)) {
pins = []; // empty board is a valid state
} else throw err;
} Prevention
- Verify the board has pins in the Pinterest UI before scripting against it
- Treat EmptyResultError as a signal to skip, not crash, in batch jobs
- Double-check username/slug spelling — wrong slugs can hit empty boards
- Run board listing first to confirm the board is non-empty
When it happens
Trigger: Calling `pinterest board-pins <username>/<slug>` against a board that genuinely contains no pins; a board whose pins are all hidden (secret/archived); passing a slug that resolves to a different user's empty board; or a fetch where rows.length === 0 at DEFAULT_PAGE_SIZE because the board was just created.
Common situations: Automating a newly created board before adding pins; typo'd board slug matching an empty test board; running the command in CI against a fresh account; assuming a board has content after a section delete moved pins back to the board.
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
- No trains found from ${fromStation.name} to ${toStation.name
- NO_DATA
- No Wayback snapshots for "${target}".
- Chess.com has no game archives for ${username}
- Chess.com has games archives for ${username} but no games in
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/ab5e928fbc819689.
Report an issue: GitHub.