{"record":{"id":"09f536ca258ed877","repo":"jackwener/OpenCLI","slug":"boss-search","errorCode":null,"errorMessage":"boss search","messagePattern":"boss search","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/boss/search.js","lineNumber":220,"sourceCode":"                    boss: j.bossName + ' · ' + j.bossTitle,\n                    bossOnline: formatBossOnline(j.bossOnline),\n                    security_id: j.encryptJobId || '',\n                    url: 'https://www.zhipin.com/job_detail/' + j.encryptJobId + '.html',\n                });\n                addedInBatch++;\n                if (allJobs.length >= limit)\n                    break;\n            }\n            if (addedInBatch === 0) {\n                verbose(`API returned duplicate page, stopping pagination at ${allJobs.length} items`);\n                break;\n            }\n            if (!zpData.hasMore)\n                break;\n            currentPage++;\n        }\n        if (allJobs.length === 0) {\n            throw new EmptyResultError('boss search', query ? `No BOSS jobs found for \"${query}\"` : 'BOSS returned no recommended jobs');\n        }\n        return allJobs;\n    },\n});\nexport const __test__ = {\n    EXP_MAP,\n    resolveCity,\n    resolveMap,\n    resolveJobType,\n    formatBossOnline,\n};\n","sourceCodeStart":202,"sourceCodeEnd":232,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/search.js#L202-L232","documentation":"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.","triggerScenarios":"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.","commonSituations":"Same as the boss-search empty result family: hyper-specific filters, empty recommendation feed, throttled/degraded BOSS responses returning empty lists.","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"],"exampleFix":"// before\nconst jobs = await cli('boss', 'search', {}); // empty recommended feed -> throws\n// after\nlet jobs;\ntry { jobs = await cli('boss', 'search', {}); }\ncatch (e) {\n  if (e.name !== 'EmptyResultError') throw e;\n  jobs = []; // treat as no recommendations right now\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  jobs = await cli('boss', 'search', opts);\n} catch (e) {\n  if (e.name === 'EmptyResultError') jobs = [];\n  else throw e;\n}","preventionTips":["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"],"tags":["empty-result","recommendation-feed","boss-zhipin"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}