Do not panic while panicking (#7167)

* Do not panic while panicking

* Update primitives/runtime/src/lib.rs

Co-authored-by: David <dvdplm@gmail.com>

* Move function to `sp-std`

Co-authored-by: David <dvdplm@gmail.com>
This commit is contained in:
Bastian Köcher
2020-09-22 09:36:46 +02:00
committed by GitHub
parent ea21afa42a
commit 38eed5f0ac
3 changed files with 31 additions and 1 deletions
+9
View File
@@ -53,3 +53,12 @@ pub mod borrow {
pub use core::borrow::*;
pub use alloc::borrow::*;
}
pub mod thread {
/// Returns if the current thread is panicking.
///
/// In wasm this always returns `false`, as we abort on any panic.
pub fn panicking() -> bool {
false
}
}