Unverified Commit df089ab5 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #287 from skalenetwork/bug/SKALE-4037-clean-sgx-error-processing

SKALE 4037 clean sgx error processing
parents 19bf094b 41fc3369
......@@ -113,7 +113,7 @@ void ServerWorker::doOneServerLoop() noexcept {
} catch (SGXException &e) {
result["status"] = e.getStatus();
result["errorMessage"] = e.getMessage();
result["errorMessage"] = e.what();
spdlog::error("Exception in zmq server worker:{}", e.what());
}
catch (std::exception &e) {
......
......@@ -78,7 +78,7 @@ void ZMQServer::run() {
frontend->bind("tcp://*:" + to_string(port));
} catch (...) {
spdlog::error("Server task could not bind to port:{}", port);
exit(-100);
exit(ZMQ_COULD_NOT_BIND_FRONT_END);
}
spdlog::info("Bound port ...");
......@@ -88,7 +88,7 @@ void ZMQServer::run() {
backend->bind("inproc://backend");
} catch (exception &e) {
spdlog::error("Could not bind to zmq backend: {}", e.what());
exit(-101);
exit(ZMQ_COULD_NOT_BIND_BACK_END);
}
......@@ -103,7 +103,7 @@ void ZMQServer::run() {
}
} catch (std::exception &e) {
spdlog::error("Could not create zmq server workers:{} ", e.what());
exit(-102);
exit(ZMQ_COULD_NOT_CREATE_WORKERS);
};
......@@ -123,7 +123,7 @@ void ZMQServer::run() {
return;
}
spdlog::info("Error, exiting zmq server ...");
return;
exit(ZMQ_COULD_NOT_CREATE_PROXY);
}
}
......@@ -152,7 +152,6 @@ void ZMQServer::exitZMQServer() {
zmqServer->exitAll();
spdlog::info("deleting zmq server");
zmqServer = nullptr;
spdlog::info("deleted zmq server ");
......
......@@ -54,10 +54,10 @@ void SGXWallet::printUsage() {
cerr << "\nBackup, restore, update flags:\n\n";
cerr << " -b filename Restore from back up or software update. You will need to put backup key into a file in sgx_data dir. \n";
cerr << " -y Do not ask user to acknowledge receipt of the backup key \n";
cerr << "\nHTTPS flags:\n\n";
cerr << " -n Launch sgxwallet using http. Default is to use https with a selg-signed server cert. \n";
cerr << " -c Do not verify SSL client certs\n";
cerr << " -s Sign SSL client certs without human confirmation \n";
cerr << "\nSecurity flags flags:\n\n";
cerr << " -n Use http instead of https. Default is to use https with a selg-signed server cert. Insecure! \n";
cerr << " -c Disable client authentication using certificates. Insecure!\n";
cerr << " -s Sign client certificates without human confirmation. Insecure! \n";
}
......
......@@ -168,6 +168,11 @@ extern bool autoconfirm;
#define ZMQ_NO_SIG_IN_MESSAGE -95
#define ZMQ_NO_CERT_IN_MESSAGE -96
#define ZMQ_COULD_NOT_VERIFY_SIG -97
#define ZMQ_COULD_NOT_BIND_FRONT_END -98
#define ZMQ_COULD_NOT_BIND_BACK_END -99
#define ZMQ_COULD_NOT_CREATE_WORKERS -100
#define ZMQ_COULD_NOT_CREATE_PROXY -101
#define SGX_ENCLAVE_ERROR -666
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment