aboutsummaryrefslogtreecommitdiff
path: root/src-tauri
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-26 11:59:22 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-26 11:59:22 +0200
commitc28e67f262180c84fecbbee7dcbaaa217c836ba3 (patch)
tree4bf68f223429d21693f14a992467eb2776192b41 /src-tauri
parentf73a31c82e152e28e84fb698edfd763105e933b5 (diff)
downloadFlightCore-c28e67f262180c84fecbbee7dcbaaa217c836ba3.tar.gz
FlightCore-c28e67f262180c84fecbbee7dcbaaa217c836ba3.zip
Add a force crash button
Diffstat (limited to 'src-tauri')
-rw-r--r--src-tauri/src/main.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 430c8111..b5cae7b9 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -29,7 +29,11 @@ fn main() {
Ok(())
})
.manage(Counter(Default::default()))
- .invoke_handler(tauri::generate_handler![hello_world, add_count])
+ .invoke_handler(tauri::generate_handler![
+ hello_world,
+ add_count,
+ force_panic
+ ])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
@@ -46,3 +50,9 @@ fn add_count(num: i32, counter: State<'_, Counter>) -> String {
format!("{val}")
}
+
+#[tauri::command]
+/// This function's only use is to force a `panic!()`
+fn force_panic() {
+ panic!("Force panicked!");
+}