{"record":{"id":"0da076c183f6ca16","repo":"jackwener/OpenCLI","slug":"query-0da076","errorCode":null,"errorMessage":"未找到匹配 \"${query}\" 的候选人","messagePattern":"未找到匹配 \"(.+?)\" 的候选人","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/maimai/search-talents.js","lineNumber":145,"sourceCode":"    if (!data || typeof data !== 'object' || Array.isArray(data)) {\n      throw new CommandExecutionError('Maimai search returned malformed API payload');\n    }\n\n    // Extract talent list from response. Missing list fields mean the API\n    // shape drifted; only an explicit empty array is a true empty result.\n    const talentListCandidates = [\n      data.data?.list,\n      data.data?.talent_list,\n      data.list,\n      data.talent_list,\n    ];\n    const talentList = talentListCandidates.find((value) => Array.isArray(value));\n    if (!talentList) {\n      throw new CommandExecutionError('Maimai search API payload missing talent list');\n    }\n\n    if (talentList.length === 0) {\n      throw new EmptyResultError('maimai search-talents', `未找到匹配 \"${query}\" 的候选人`);\n    }\n\n    // Map to output format\n    return talentList.map(item => {\n      // Extract school info (first one)\n      const schoolInfo = item.edu && item.edu.length > 0 ? item.edu[0] : {};\n\n      // Work years: use work_time field directly (e.g., \"11 年\", \"10 年\")\n      const workYear = item.work_time || item.worktime || '';\n\n      // Extract all companies from work experience (deduplicated, excluding current company)\n      const currentCompany = item.company || '';\n      const historicalCompanies = (item.exp || [])\n        .map(e => e.company)\n        .filter(c => c && c.trim() !== '' && c !== currentCompany)\n        .filter((c, i, arr) => arr.indexOf(c) === i)\n        .join(' / ');\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/maimai/search-talents.js#L127-L163","documentation":"EmptyResultError signalling a genuinely successful query whose talent list was an explicit empty array — no candidates matched the query. Unlike the missing-list case, this is an expected, non-failure outcome.","triggerScenarios":"maimai search API returned code 200/0 with an empty list for the given query keywords/filters.","commonSituations":"Overly specific search terms, rare job titles or employers, filters (industry/location) too narrow, non-Chinese query terms with no matches.","solutions":["Broaden the query keywords (shorter, more generic terms).","Remove or relax filters passed to search-talents.","Try alternate spellings or Chinese-language search terms.","Confirm the target person exists by searching maimai.cn in the browser."],"exampleFix":"// before\nmaimai search-talents \"Senior VP of Platform Engineering at Acme Corp Hangzhou\"\n// after\nmaimai search-talents \"Acme Corp\"  # broaden, then refine client-side","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const talents = await searchTalents(query);\n} catch (e) {\n  if (e instanceof EmptyResultError || /未找到匹配/.test(e.message)) {\n    console.warn(`No candidates for \"${query}\"; try broader keywords`);\n    talents = [];\n  } else throw e;\n}","preventionTips":["Broaden search terms before assuming the CLI is broken.","Treat empty results as normal and handle them in batch pipelines.","Pre-check the person exists via maimai.cn web search for rare queries."],"tags":["empty-result","search","query"],"backgroundTag":"empty-search-result","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}