ErrLookupBackground articles › EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows

EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows

EmptyResultError, "No tasks match the specified criteria", "no pins found", and similar "empty result set" errors are thrown when a request completes successfully — no network failure, no auth problem — but the returned data is an empty list: zero rows, zero items, zero messages. This page explains why libraries turn empty results into typed errors instead of returning [], what actually caused the emptiness, and how to handle it as an expected 'no data' outcome.

Distilled from 245 documented records across 9 repositories.

Background

The empty-result-set family sits at the boundary between 'the call worked' and 'there is nothing to show'. In every record, the underlying request succeeded: the HTTP call returned 200, the page rendered, the JSON parsed. What failed — if it can be called a failure — is that the collection was empty. Instead of returning an empty array and letting the caller print an empty table, libraries in this family raise a typed error: OpenCLI throws EmptyResultError with an EMPTY_RESULT exit code distinct from CommandExecutionError (malformed payloads), claude-task-master's ExportService returns a non-throwing NO_TASKS result, Rocket.Chat converts a zero pruned-message count into a translated error toast, and Vagrant's box prune prints a warning and ends without reaching its success line. The common intent is to make 'no data' explicit and distinguishable from the two failure modes it most resembles: broken scraping (selector drift, unrendered DOM) and broken requests (auth walls, network errors).

The layer that produces the error varies. Some libraries check the data at the API boundary: Stack Overflow's /questions/{id} endpoint returns a 200 envelope with an empty items array instead of a 404 for missing questions, and the CLI surfaces 'Question not found' as a typed empty result. Others check after DOM scraping: the Ctrip flight and ferry commands throw only when renderedCardCount is 0, so a page that rendered cards but failed parsing gets a different error; Booking.com's hotel search additionally inspects the page's result-count text before concluding the results are genuinely empty. Others still inspect local state: Trae SOLO's extensions-list throws EmptyResultError when extensions.json exists, parses, and contains an empty array — explicitly 'file OK, zero extensions', distinct from the missing-file error. Some checks are semantic: powerchina search throws when extraction produced rows but all of them were site-navigation chrome rather than real bid entries, and Discord's thread-read treats an empty message list as a failed read because a thread must contain at least its originating message.

From the caller's side, the signal is designed to be branchable. OpenCLI records repeatedly document err.code === 'EMPTY_RESULT' as an expected skip path in batch scripts — the Xiaohongshu notes crawler even instructs consumers to exclude empty-author errors from softFail and rate-limit accounting, and the boss chatmsg command treats the error as the end-of-pagination signal. The libraries disagree on one point deliberately: whether empty is an exception or a soft result. OpenCLI throws a typed exception almost everywhere; claude-task-master returns a failure result without throwing; Rocket.Chat and Vagrant surface a warning or toast and continue. Treat that as library-specific and check the contract of the library you use.

The underlying causes cluster into a few shapes across the nine repositories. The data genuinely does not exist: a Xianyu account with no conversations, a Bilibili video with no subtitle tracks, an empty Pinterest board, a flight route with no service on those dates, two HLTV players with no shared match in the requested window. The query or filter excludes everything: a too-narrow Sales Navigator keyword, an export status filter matching no tasks, prune filters that match zero messages. And the session cannot see data that does exist: an unauthenticated browser where Discord's sidebar or TikTok's notifications would render, a Pixiv safe-mode filter returning empty page lists for restricted works, an expired cookie replaced by a login wall. The first two are true empty results; the third is an empty result that mimics one, which is why several libraries pair the error with hints about checking the same page in a real browser.

Common causes

What usually fixes it

Go deeper

Documented occurrences

…and 225 more across the corpus — use search.

Honest provenance: generated on 2026-08-29 from AI-assisted analysis of the linked records. See how records are made.