Documentation and small cleanup in panic-handler (#3249)

* Documentation and small cleanup in panic-handler

* Apply suggestions from code review

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
This commit is contained in:
Pierre Krieger
2019-08-01 09:53:53 +02:00
committed by Gavin Wood
parent de02aee156
commit cb7383b6b6
3 changed files with 72 additions and 29 deletions
@@ -34,7 +34,7 @@ fn safe_call<F, U>(f: F) -> Result<U>
where F: UnwindSafe + FnOnce() -> U
{
// Substrate uses custom panic hook that terminates process on panic. Disable termination for the native call.
let _guard = panic_handler::AbortGuard::new(false);
let _guard = panic_handler::AbortGuard::force_unwind();
::std::panic::catch_unwind(f).map_err(|_| Error::Runtime)
}