{"record":{"id":"b5c964e99ea7bbb7","repo":"tauri-apps/tauri","slug":"error-dialog-is-not-implemented-for-this-platform","errorCode":null,"errorMessage":"Error dialog is not implemented for this platform","messagePattern":"Error dialog is not implemented for this platform","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/tauri-runtime-wry/src/dialog/mod.rs","lineNumber":17,"sourceCode":"// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n\n#[cfg(windows)]\nmod windows;\n\n// Takes a `&'static str` here since we convert clickable hyperlinks,\n// DO NOT pass in untrusted input\n#[cfg_attr(not(windows), allow(unused))]\npub fn error(err: &'static str) {\n  #[cfg(windows)]\n  windows::error(err);\n\n  #[cfg(not(windows))]\n  {\n    unimplemented!(\"Error dialog is not implemented for this platform\");\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-runtime-wry/src/dialog/mod.rs#L1-L20","documentation":"tauri-runtime-wry's dialog::error shows a native error message box. Only the Windows backend is implemented; on any other platform the function panics via unimplemented!. This is an internal runtime helper used to surface fatal initialization errors (e.g. Wry creation failures) as a dialog.","triggerScenarios":"Calling tauri_runtime_wry::dialog::error directly on Linux/macOS, or hitting a fatal runtime initialization path on non-Windows that funnels into it.","commonSituations":"Wry failing to initialize (missing WebKitGTK on Linux) and the runtime attempting to show the error dialog; porting code that used the Windows-only helper to another OS.","solutions":["On Linux install the required WebKitGTK packages (libwebkit2gtk-4.1-dev) so the failing initialization path is never hit","Log the error with eprintln/log crate instead of calling dialog::error on non-Windows","Gate the call with #[cfg(windows)] and use an OS-appropriate fallback"],"exampleFix":"// before\ndialog::error(\"failed to create webview\");\n// after\n#[cfg(windows)]\ndialog::error(\"failed to create webview\");\n#[cfg(not(windows))]\neprintln!(\"failed to create webview\");","handlingStrategy":"fallback","validationCode":"#[cfg(not(windows))]\nfn can_show_error_dialog() -> bool { false }","typeGuard":"fn supports_error_dialog() -> bool { cfg!(windows) }","tryCatchPattern":"if cfg!(windows) { dialog::error(msg); } else { eprintln!(\"{msg}\"); }","preventionTips":["Install WebKitGTK dev packages on Linux so fatal init paths don't trigger","Never call platform-gated helpers without cfg guards","Provide a logging fallback for user-facing fatal errors on all platforms"],"tags":["dialog","platform-specific","unimplemented","wry"],"backgroundTag":"unsupported-platform","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}