4namespace sysio {
namespace chain {
namespace webassembly {
5 inline static constexpr size_t max_assert_message = 1024;
7 SYS_ASSERT(
false, abort_called,
"abort() called" );
11 if( BOOST_UNLIKELY( !condition ) ) {
12 const size_t sz = strnlen( msg.
data(), max_assert_message );
13 std::string message( msg.
data(), sz );
14 SYS_THROW( sysio_assert_message_exception,
"assertion failure with message: ${s}", (
"s",message) );
19 if( BOOST_UNLIKELY( !condition ) ) {
20 const size_t sz = msg.size() > max_assert_message ? max_assert_message : msg.size();
21 std::string message( msg.data(), sz );
22 SYS_THROW( sysio_assert_message_exception,
"assertion failure with message: ${s}", (
"s",message) );
27 if( BOOST_UNLIKELY( !condition ) ) {
31 "sysio_assert_code called with reserved error code: ${error_code}",
32 (
"error_code", error_code)
39 "assertion failure with error code: ${error_code}",
40 (
"error_code", error_code)
42 e.error_code = error_code;
49 context.control.get_wasm_interface().exit();
#define SYS_THROW(exc_type, FORMAT,...)
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
void sysio_exit(int32_t code) const
void sysio_assert_message(bool condition, legacy_span< const char > msg) const
void sysio_assert_code(bool condition, uint64_t error_code) const
void sysio_assert(bool condition, null_terminated_ptr msg) const
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.
@ contract_restricted_error_code
unsigned __int64 uint64_t
const char * data() const