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 KriegerandSergei Pepyakin authored and Gavin Wood committed 2019-08-01 09:53:53 +02:00
1 parent de02aee156
commit cb7383b6b6
3 files changed
+72 -29

No files matched your search

@@ -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)
}