{"record":{"id":"c72296c6892bbc79","repo":"jackwener/OpenCLI","slug":"youdao-note-parser-failed-reason","errorCode":null,"errorMessage":"Youdao note parser failed: ${reason}","messagePattern":"Youdao note parser failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/youdao/note.js","lineNumber":186,"sourceCode":"    })()\n  `;\n}\n\nfunction normalizeExtractionResult(payload, sourceUrl) {\n  const data = unwrapEvaluateResult(payload);\n  if (!Array.isArray(data)) {\n    throw new CommandExecutionError('Youdao note extractor returned a malformed payload');\n  }\n  const ok = data[0] === true;\n  if (!ok) {\n    const reason = typeof data[1] === 'string' && data[1].trim() ? data[1].trim() : 'unknown_parser_failure';\n    if (reason === 'auth') {\n      throw new AuthRequiredError('note.youdao.com', 'Youdao shared note requires login or additional permission');\n    }\n    if (reason === 'not_found') {\n      throw new EmptyResultError('youdao note', 'The shared note is missing, expired, cancelled, or inaccessible.');\n    }\n    throw new CommandExecutionError(`Youdao note parser failed: ${reason}`);\n  }\n  const title = String(data[1] ?? '');\n  const content = String(data[2] ?? '');\n  const summary = String(data[3] ?? '');\n  const keywords = String(data[4] ?? '');\n  const createTime = data[5];\n  const fileSize = data[6];\n  const hasContentField = data[7] === true;\n  const rawContentLength = Number(data[8] ?? 0);\n  const finalUrl = String(data[9] || sourceUrl);\n  if (!title) {\n    throw new CommandExecutionError('Youdao note parser did not extract a title');\n  }\n  if (!hasContentField) {\n    throw new CommandExecutionError('Youdao note parser did not find full note content in the page store');\n  }\n  if (rawContentLength > 0 && !content) {\n    throw new CommandExecutionError('Youdao note parser found note content but extracted no readable text');","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/youdao/note.js#L168-L204","documentation":"CommandExecutionError thrown by normalizeExtractionResult when extraction failed with a reason that is neither 'auth' nor 'not_found' (e.g. 'root_missing', 'react_root_missing', 'store_missing', 'content_data_missing', 'unknown_parser_failure'). The raw reason string is interpolated into the message, indicating Youdao's page structure didn't match what the extractor expects.","triggerScenarios":"Page rendered '#root' missing (blocked/blank page or network error page); React fiber root not found (Youdao changed framework or hydration delayed); Redux-like store not present in fiber tree; store.content.data missing (page redesign); body text didn't classify but extraction still failed.","commonSituations":"Youdao A/B testing or redesigning the notes page; very slow networks where the SPA hasn't hydrated within the wait window; headless browser being served a simplified/anti-bot page; CDN/region variants rendering different markup.","solutions":["Retry; SPA hydration timing is a frequent cause of store_missing/react_root_missing","Read the interpolated reason in the message ('store_missing', 'root_missing', etc.) to target the actual failure stage","Upgrade the CLI to a version whose buildExtractorJs matches the current Youdao page structure","Increase the pre-evaluate wait (the command waits #root/.file-name/body then ~2s) or run on a faster/stabler network","Capture a page screenshot/DOM dump at failure time to confirm Youdao's markup and report upstream if the structure changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function withRetry(url, attempts = 3) {\n  for (let i = 0; i < attempts; i++) {\n    try { return await youdaoNote(url); }\n    catch (e) {\n      const m = String(e.message);\n      if (/parser failed/.test(m) && i < attempts - 1) { await new Promise(r => setTimeout(r, 2000 * (i + 1))); continue; }\n      throw e;\n    }\n  }\n}","preventionTips":["Retry with backoff — slow SPA hydration is the most common cause (store_missing/react_root_missing)","Parse the interpolated reason from the message to choose targeted remediation","Keep the extractor version in sync with Youdao's current page structure","Capture DOM/screenshot on final failure for upstream bug reports"],"tags":["command-execution-error","parser-failure","page-structure-change","browser-extraction"],"backgroundTag":"page-structure-parser-failure","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}