mirror of https://github.com/tildeio/helix
Allow any closure to be used with catch_panic
Asserting unwind safe is supposed to mean that we poison mutable object involved in the panic (to prevent objects that were involved in panics from triggering errors over and over again) and we should do that in the future.
This commit is contained in:
parent
41172104ab
commit
27d4a7458b
|
@ -331,9 +331,11 @@ macro_rules! handle_exception {
|
|||
}));
|
||||
}
|
||||
|
||||
let res = ::std::panic::catch_unwind(|| {
|
||||
// TODO: Poison any objects that cross the boundary to prevent them
|
||||
// from being used in Ruby and triggering panics over and over again.
|
||||
let res = ::std::panic::catch_unwind(::std::panic::AssertUnwindSafe(|| {
|
||||
$($body)*
|
||||
});
|
||||
}));
|
||||
|
||||
if hide_err {
|
||||
let _ = ::std::panic::take_hook();
|
||||
|
|
Loading…
Reference in New Issue