未验证 提交 9e35ed04 编写于 作者: Z zorba80 提交者: GitHub

Merge branch 'master' into issue3189

......@@ -526,8 +526,10 @@ fc::variant read_only::get_block(const read_only::get_block_params& params) cons
read_write::push_block_results read_write::push_block(const read_write::push_block_params& params) {
try {
db.push_block( std::make_shared<signed_block>(params) );
} catch ( ... ) {
} catch ( boost::interprocess::bad_alloc& ) {
raise(SIGUSR1);
} catch ( ... ) {
throw;
}
return read_write::push_block_results();
}
......@@ -547,8 +549,10 @@ read_write::push_transaction_results read_write::push_transaction(const read_wri
pretty_output = db.to_variant_with_abi( *trx_trace_ptr );;
//abi_serializer::to_variant(*trx_trace_ptr, pretty_output, resolver);
id = trx_trace_ptr->id;
} catch ( ... ) {
} catch ( boost::interprocess::bad_alloc& ) {
raise(SIGUSR1);
} catch ( ... ) {
throw;
}
return read_write::push_transaction_results{ id, pretty_output };
}
......@@ -566,8 +570,10 @@ read_write::push_transactions_results read_write::push_transactions(const read_w
fc::mutable_variant_object( "error", e.to_detail_string() ) } );
}
}
} catch ( ... ) {
} catch ( boost::interprocess::bad_alloc& ) {
raise(SIGUSR1);
} catch ( ... ) {
throw;
}
return result;
}
......
......@@ -79,6 +79,13 @@ void initialize_logging()
logging_conf_loop();
}
enum return_codes {
INITIALIZE_FAIL = -1,
SUCCESS = 0,
BAD_ALLOC = 1,
OTHER_FAIL = 2
};
int main(int argc, char** argv)
{
try {
......@@ -89,7 +96,7 @@ int main(int argc, char** argv)
app().set_default_data_dir(root / "eosio/nodeos/data" );
app().set_default_config_dir(root / "eosio/nodeos/config" );
if(!app().initialize<chain_plugin, http_plugin, net_plugin, producer_plugin>(argc, argv))
return -1;
return INITIALIZE_FAIL;
initialize_logging();
ilog("nodeos version ${ver}", ("ver", eosio::utilities::common::itoh(static_cast<uint32_t>(app().version()))));
ilog("eosio root is ${root}", ("root", root.string()));
......@@ -97,17 +104,20 @@ int main(int argc, char** argv)
app().exec();
} catch (const fc::exception& e) {
elog("${e}", ("e",e.to_detail_string()));
return OTHER_FAIL;
} catch (const boost::interprocess::bad_alloc& e) {
elog("bad alloc");
//elog("${e}", ("e", boost::diagnostic_information(e)));
return 3;
return BAD_ALLOC;
} catch (const boost::exception& e) {
elog("${e}", ("e",boost::diagnostic_information(e)));
return OTHER_FAIL;
} catch (const std::exception& e) {
elog("${e}", ("e",e.what()));
return OTHER_FAIL;
} catch (...) {
elog("unknown exception");
return OTHER_FAIL;
}
return 0;
return SUCCESS;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册