TARAXA
taraxa::state_api::ErrorHandler Class Reference

Public Member Functions

 ErrorHandler ()=default
 
void check ()
 

Public Attributes

taraxa_evm_BytesCallback const cgo_part_
 

Private Attributes

std::function< void()> raise_
 

Constructor & Destructor Documentation

◆ ErrorHandler()

taraxa::state_api::ErrorHandler::ErrorHandler ( )
default

Member Function Documentation

◆ check()

void taraxa::state_api::ErrorHandler::check ( )
inline

Member Data Documentation

◆ cgo_part_

taraxa_evm_BytesCallback const taraxa::state_api::ErrorHandler::cgo_part_
Initial value:
{
this,
[](auto self, auto err_bytes) {
auto& raise = decltype(this)(self)->raise_;
static string const delim = ": ";
static auto const delim_len = delim.size();
std::string_view err_str((char*)err_bytes.Data, err_bytes.Len);
auto delim_pos = err_str.find(delim);
string type(err_str.substr(0, delim_pos));
string msg(err_str.substr(delim_pos + delim_len));
if (type == "github.com/Taraxa-project/taraxa-evm/taraxa/state/state_db/ErrFutureBlock") {
raise = [err = ErrFutureBlock(std::move(type), msg)] { BOOST_THROW_EXCEPTION(err); };
return;
}
string traceback;
taraxa_evm_traceback(decoder_cb_c<string, to_str>(traceback));
msg += "\nGo stack trace:\n" + traceback;
raise = [err = TaraxaEVMError(std::move(type), msg)] { BOOST_THROW_EXCEPTION(err); };
},
}
std::function< void()> raise_
Definition: state_api.cpp:42

◆ raise_

std::function<void()> taraxa::state_api::ErrorHandler::raise_
private

The documentation for this class was generated from the following file: