cosmwasm-std 1.1.2

Standard library for Wasm based smart contracts on Cosmos blockchains
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Installs a panic handler that aborts the contract execution
/// and sends the panic message and location to the host.
///
/// This overrides any previous panic handler. See <https://doc.rust-lang.org/std/panic/fn.set_hook.html>
/// for details.
#[cfg(all(feature = "abort", target_arch = "wasm32"))]
pub fn install_panic_handler() {
    use super::imports::handle_panic;
    std::panic::set_hook(Box::new(|info| {
        // E.g. "panicked at 'oh no (a = 3)', src/contract.rs:51:5"
        let full_message = info.to_string();
        handle_panic(&full_message);
    }));
}