{"record":{"id":"4d3f6f8eb927fca7","repo":"Zackriya-Solutions/meetily","slug":"error-lib","errorCode":null,"errorMessage":"{error}","messagePattern":"\\{error\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"frontend/src-tauri/src/lib.rs","lineNumber":73,"sourceCode":"pub mod utils;\npub mod whisper_engine;\n\nuse audio::{list_audio_devices, AudioDevice, trigger_audio_permission};\nuse log::{error as log_error, info as log_info};\nuse notifications::commands::NotificationManagerState;\nuse std::sync::Arc;\nuse tauri::{AppHandle, Manager, Runtime};\nuse tokio::sync::RwLock;\n\nstatic RECORDING_FLAG: AtomicBool = AtomicBool::new(false);\n\n#[cfg(target_os = \"windows\")]\nstatic ONNX_RUNTIME_INIT_ERROR: std::sync::OnceLock<String> = std::sync::OnceLock::new();\n\npub(crate) fn ensure_onnx_runtime_available() -> anyhow::Result<()> {\n    #[cfg(target_os = \"windows\")]\n    if let Some(error) = ONNX_RUNTIME_INIT_ERROR.get() {\n        anyhow::bail!(\"{error}\");\n    }\n\n    Ok(())\n}\n\n#[cfg(target_os = \"windows\")]\nfn catch_onnx_runtime_init<F, E>(init: F) -> Result<(), String>\nwhere\n    F: FnOnce() -> Result<(), E>,\n    E: std::fmt::Display,\n{\n    match std::panic::catch_unwind(std::panic::AssertUnwindSafe(init)) {\n        Ok(result) => result.map_err(|error| error.to_string()),\n        Err(payload) => {\n            let message = payload\n                .downcast_ref::<&str>()\n                .copied()\n                .or_else(|| payload.downcast_ref::<String>().map(String::as_str))","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/lib.rs#L55-L91","documentation":"On Windows, ensure_onnx_runtime_available rethrows a previously recorded ONNX Runtime initialization failure stored in the ONNX_RUNTIME_INIT_ERROR OnceLock. If the ONNX runtime DLL failed to load earlier in the process (e.g. missing onnxruntime.dll or wrong architecture), every later transcription path that calls this guard fails with the saved error string via anyhow::bail!.","triggerScenarios":"Calling any transcription/whisper/parakeet entry point that calls ensure_onnx_runtime_available() on Windows after ONNX runtime init already failed and stored its error in ONNX_RUNTIME_INIT_ERROR.","commonSituations":"onnxruntime DLL not shipped next to the exe, onnxruntime_dynamic_loading / load-dynamic feature mismatch, x86_64 binary on ARM64 or vice versa, CUDA/TensorRT provider DLLs missing, PATH not containing the runtime directory.","solutions":["Read the embedded error string (it names the original DLL/load failure) and fix the root cause: ship the correct onnxruntime.dll beside the executable.","Match runtime architecture to the binary (x64 vs arm64) and include required provider DLLs (onnxruntime_providers_shared.dll, CUDA deps if enabled).","Reinstall/repair the app or re-download bundled models/runtime; on dev, rebuild with the matching ort features (e.g. load-dynamic with correct ORT env or default linking)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match ensure_onnx_runtime_available() {\n    Ok(()) => { /* proceed with transcription */ }\n    Err(e) => {\n        log::error!(\"ONNX runtime unavailable: {e}\");\n        // surface a user-facing 'missing runtime components' dialog\n    }\n}","preventionTips":["Bundle onnxruntime.dll (correct arch) next to the executable in the installer.","Smoke-test runtime load at app startup, not at first transcription.","Pin ort/whisper-rs versions and document required DLLs (incl. CUDA providers if enabled).","Verify DLL loading with dumpbin /dependencies or Dependencies.exe in CI on Windows."],"tags":["windows","onnx","dll-loading","initialization"],"backgroundTag":"module-init-failed","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}