{"record":{"id":"7b01b52d68606817","repo":"BigPizzaV3/CodexPlusPlus","slug":"native-menu-localizer-threw-exception","errorCode":null,"errorMessage":"native menu localizer threw: {exception}","messagePattern":"native menu localizer threw: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/native_menu.rs","lineNumber":197,"sourceCode":"                    .web_socket_debugger_url\n                    .as_deref()\n                    .is_some_and(|url| !url.is_empty())\n            })\n        })\n        .context(\"No Electron main-process inspector target found\")?;\n    let websocket_url = target\n        .web_socket_debugger_url\n        .as_deref()\n        .context(\"selected inspector target has no websocket URL\")?;\n    let script = native_menu_localizer_script()?;\n    let result = crate::bridge::evaluate_script_with_await_promise(websocket_url, &script, true)\n        .await\n        .context(\"failed to evaluate native menu localizer\")?;\n    if let Some(exception) = result\n        .get(\"result\")\n        .and_then(|value| value.get(\"exceptionDetails\"))\n    {\n        bail!(\"native menu localizer threw: {exception}\");\n    }\n    let _ = crate::diagnostic_log::append_diagnostic_log(\n        \"native_menu.localization_installed\",\n        json!({\n            \"inspector_port\": inspector_port,\n            \"target_type\": target.target_type,\n            \"target_title\": target.title,\n            \"result\": result\n        }),\n    );\n    Ok(())\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/native_menu.rs#L179-L215","documentation":"Formatted error thrown by try_install_native_menu_localizer when the injected native-menu localizer script evaluates but reports that its internal localizer threw an exception ({exception} is the JS-side error text). The offending input is the Electron renderer environment the script ran in — the script itself was found and evaluated; the failure is at runtime inside the localizer, and install_native_menu_localizer surfaces the JS detail.","triggerScenarios":"Thrown at crates/codex-plus-core/src/native_menu.rs:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["检查 Codex App 版本是否与本地化脚本兼容","升级 Codex++ 以匹配更新的菜单结构","查看异常文本定位脚本中失败的 API 调用"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}