pub fn panic_str(message: &str) -> !
Expand description
Terminates the execution of the program with the UTF-8 encoded message.
§Examples
ⓘ
use near_sdk::env::panic_str;
panic_str("Unexpected error");
ⓘ
use near_sdk::env::panic_str;
use near_sdk::AccountId;
use std::str::FromStr;
let account = AccountId::from_str("bob.near").unwrap();
panic_str(format!("Unexpected error happened for account {}", account).as_str());