Function panic

Source
pub fn panic(message: &[u8]) -> !
๐Ÿ‘ŽDeprecated since 4.0.0: Use env::panic_str to panic with a message.
Expand description

Terminates the execution of the program with the UTF-8 encoded message. panic_str should be used as the bytes are required to be UTF-8

ยงExamples

โ“˜
use near_sdk::env::panic;

panic(b"Unexpected error");