From 1258aabee79e53cafaba6c7239a94ebf2cffc134 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 18 Jul 2019 16:11:17 +0200 Subject: [PATCH] Better error message if loading fails. --- test/EVMHost.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index b12b006ed..f18abc10d 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -45,6 +45,13 @@ evmc::vm* EVMHost::getVM(string const& _path) evmc_instance* vm = evmc_load_and_create(_path.c_str(), &errorCode); if (vm && errorCode == EVMC_LOADER_SUCCESS) theVM = make_unique(vm); + else + { + cerr << "Error loading VM from " << _path; + if (char const* errorMsg = evmc_last_error_msg()) + cerr << ":" << endl << errorMsg; + cerr << endl; + } } return theVM.get(); }