aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src')
-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!");
+}