summaryrefslogtreecommitdiff
path: root/src/handle_unwind.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handle_unwind.rs')
-rw-r--r--src/handle_unwind.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/handle_unwind.rs b/src/handle_unwind.rs
index d515449..220d379 100644
--- a/src/handle_unwind.rs
+++ b/src/handle_unwind.rs
@@ -1,5 +1,6 @@
use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
+/// Runs `try_fn`. If it unwinds, it will run `catch` and then continue unwinding
pub fn handle_unwind<R, F: FnOnce() -> R, G: FnOnce()>(try_fn: F, catch: G) -> R {
let try_fn = AssertUnwindSafe(try_fn);
catch_unwind(try_fn).unwrap_or_else(|e| {