aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2025-01-05 01:27:14 +0100
committerGeckoEidechse <gecko.eidechse+git@pm.me>2025-01-05 01:27:14 +0100
commitfa820132e1aa3252dc197f37eeb20591fce1289b (patch)
tree3ca819d175d3a97e716dfd06623da10121e8118d
parent3dd029c877d5fe967eb998952b0b38b1d9a3e46f (diff)
downloadFlightCore-fa820132e1aa3252dc197f37eeb20591fce1289b.tar.gz
FlightCore-fa820132e1aa3252dc197f37eeb20591fce1289b.zip
feat: Log error if launching FlightCore fails
-rw-r--r--src-tauri/src/lib.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index daa8f50d..450f212b 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -48,7 +48,7 @@ pub fn run() {
},
));
- tauri::Builder::default()
+ let tauri_builder_res = tauri::Builder::default()
.plugin(tauri_plugin_store::Builder::new().build())
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![
@@ -98,8 +98,26 @@ pub fn run() {
util::kill_northstar,
util::open_repair_window,
])
- .run(tauri::generate_context!())
- .expect("error while running tauri application");
+ .run(tauri::generate_context!());
+
+ match tauri_builder_res {
+ Ok(()) => (),
+ Err(err) => {
+ // Failed to launch system native web view
+
+ // Log error on Linux
+ #[cfg(not(target_os = "windows"))]
+ {
+ log::error!("{err}");
+ }
+
+ // On Windows we can show an error window using Windows API to show how to install WebView2
+ #[cfg(target_os = "windows")]
+ {
+ log::error!("{err}");
+ }
+ }
+ };
}
/// Defines how Titanfall2 was installed (Steam, Origin, ...)