jackwener/OpenCLI · warning · EmptyResultError
boss search
Error message
boss search
What it means
This EmptyResultError belongs to the boss search command ('boss search' is the message/subject); it is thrown in the same data-collection flow as the EmptyResultError above when the aggregated job list ends up empty after pagination.
Source
Thrown at clis/boss/search.js:220
boss: j.bossName + ' · ' + j.bossTitle,
bossOnline: formatBossOnline(j.bossOnline),
security_id: j.encryptJobId || '',
url: 'https://www.zhipin.com/job_detail/' + j.encryptJobId + '.html',
});
addedInBatch++;
if (allJobs.length >= limit)
break;
}
if (addedInBatch === 0) {
verbose(`API returned duplicate page, stopping pagination at ${allJobs.length} items`);
break;
}
if (!zpData.hasMore)
break;
currentPage++;
}
if (allJobs.length === 0) {
throw new EmptyResultError('boss search', query ? `No BOSS jobs found for "${query}"` : 'BOSS returned no recommended jobs');
}
return allJobs;
},
});
export const __test__ = {
EXP_MAP,
resolveCity,
resolveMap,
resolveJobType,
formatBossOnline,
};
View on GitHub (pinned to 49907e53dc)
Solutions
- Broaden the query keyword or remove filters
- Search a larger city or 全国
- Retry later; verify the same search manually on the BOSS website
- Catch EmptyResultError and handle gracefully as zero results
Example fix
// before
const jobs = await cli('boss', 'search', {}); // empty recommended feed -> throws
// after
let jobs;
try { jobs = await cli('boss', 'search', {}); }
catch (e) {
if (e.name !== 'EmptyResultError') throw e;
jobs = []; // treat as no recommendations right now
} Defensive patterns
Strategy: try-catch
Try / catch
try {
jobs = await cli('boss', 'search', opts);
} catch (e) {
if (e.name === 'EmptyResultError') jobs = [];
else throw e;
} Prevention
- Avoid over-restrictive filter combinations
- Retry empty recommendation feeds later in the day
- Cache last good results to smooth over empty responses
- Confirm genuine zero-result searches on the website
When it happens
Trigger: Identical to error 566/567's sibling case: every captured page returned a payload without usable jobList entries or hasMore ended with allJobs.length === 0 for the given query/filters.
Common situations: Same as the boss-search empty result family: hyper-specific filters, empty recommendation feed, throttled/degraded BOSS responses returning empty lists.
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
- 未找到该候选人
- Boss returned no messages for this chat.
- 未找到该聊天(geek 侧)
- uid 在招聘端与求职端聊天列表中均未找到
- boss candidate search
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/09f536ca258ed877.
Report an issue: GitHub.