jackwener/OpenCLI · warning · EmptyResultError

No Flomo memos matched the requested filters.

Error message

No Flomo memos matched the requested filters.

What it means

clis/flomo/memos.js throws EmptyResultError when the Flomo API responded correctly but zero memos matched the filters supplied to the `flomo memos` command. This is a 'success with no rows' signal, not a failure of the API call itself, so callers can distinguish it from malformed data or auth failures.

Source

Thrown at clis/flomo/memos.js:215

    const slug = parseSlugArg(kwargs.slug);
    await page.wait(3).catch(() => {});
    const token = await readAccessToken(page);
    const body = await fetchFlomoJson(buildSignedUrl(limit, since, slug), token);
    if (!body || typeof body !== 'object' || Array.isArray(body)) {
      throw new CommandExecutionError('Flomo API returned a malformed response');
    }
    if (body.code !== 0) {
      const message = body.message || `Flomo API error code ${body.code}`;
      if (isAuthFailureMessage(message)) {
        throw new AuthRequiredError(FLOMO_API_DOMAIN, message);
      }
      throw new CommandExecutionError(message);
    }
    if (!Array.isArray(body.data)) {
      throw new CommandExecutionError('Flomo API returned malformed memo data');
    }
    if (body.data.length === 0) {
      throw new EmptyResultError('flomo memos', 'No Flomo memos matched the requested filters.');
    }
    return body.data.map(normalizeMemo);
  },
});

export const __test__ = {
  buildSignedUrl,
  command,
  normalizeMemo,
  parsePositiveIntArg,
  parseSinceArg,
  parseSlugArg,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Relax or remove one filter at a time (search term, tag, date range) to find which one excludes everything
  2. Verify exact tag spelling and casing against memos listed without filters
  3. Run `flomo memos` with no filters to confirm the account has data at all

Example fix

// before
opencli flomo memos --tag "worklog" --from 2020-01-01
// after
opencli flomo memos --tag "work"   # or drop --from to widen the range
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const memos = await flomoMemos(filters);
  if (memos.length === 0) {
    console.warn('No memos matched; check filters');
  }
} catch (err) {
  if (err.name === 'EmptyResultError') {
    // treat as empty state, not a crash: render empty UI / exit 0 with notice
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: `opencli flomo memos` invoked with filter options (search text, tag, date range) that no memo satisfies; the account genuinely has no memos matching the query.

Common situations: Typos in tag names or search keywords; filtering by a date range before the account existed; querying a fresh account with no memos; over-restrictive combination of filters.

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/171b707ba17cc8cf. Report an issue: GitHub.