Unverified Commit 41fc3369 authored by kladko's avatar kladko

SKALE 4037 clean sgx error processing

parent 19bf094b
...@@ -113,7 +113,7 @@ void ServerWorker::doOneServerLoop() noexcept { ...@@ -113,7 +113,7 @@ void ServerWorker::doOneServerLoop() noexcept {
} catch (SGXException &e) { } catch (SGXException &e) {
result["status"] = e.getStatus(); result["status"] = e.getStatus();
result["errorMessage"] = e.getMessage(); result["errorMessage"] = e.what();
spdlog::error("Exception in zmq server worker:{}", e.what()); spdlog::error("Exception in zmq server worker:{}", e.what());
} }
catch (std::exception &e) { catch (std::exception &e) {
......
...@@ -78,7 +78,7 @@ void ZMQServer::run() { ...@@ -78,7 +78,7 @@ void ZMQServer::run() {
frontend->bind("tcp://*:" + to_string(port)); frontend->bind("tcp://*:" + to_string(port));
} catch (...) { } catch (...) {
spdlog::error("Server task could not bind to port:{}", port); spdlog::error("Server task could not bind to port:{}", port);
exit(-100); exit(ZMQ_COULD_NOT_BIND_FRONT_END);
} }
spdlog::info("Bound port ..."); spdlog::info("Bound port ...");
...@@ -88,7 +88,7 @@ void ZMQServer::run() { ...@@ -88,7 +88,7 @@ void ZMQServer::run() {
backend->bind("inproc://backend"); backend->bind("inproc://backend");
} catch (exception &e) { } catch (exception &e) {
spdlog::error("Could not bind to zmq backend: {}", e.what()); 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() { ...@@ -103,7 +103,7 @@ void ZMQServer::run() {
} }
} catch (std::exception &e) { } catch (std::exception &e) {
spdlog::error("Could not create zmq server workers:{} ", e.what()); 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() { ...@@ -123,7 +123,7 @@ void ZMQServer::run() {
return; return;
} }
spdlog::info("Error, exiting zmq server ..."); spdlog::info("Error, exiting zmq server ...");
return; exit(ZMQ_COULD_NOT_CREATE_PROXY);
} }
} }
...@@ -152,7 +152,6 @@ void ZMQServer::exitZMQServer() { ...@@ -152,7 +152,6 @@ void ZMQServer::exitZMQServer() {
zmqServer->exitAll(); zmqServer->exitAll();
spdlog::info("deleting zmq server"); spdlog::info("deleting zmq server");
zmqServer = nullptr; zmqServer = nullptr;
spdlog::info("deleted zmq server "); spdlog::info("deleted zmq server ");
......
...@@ -54,10 +54,10 @@ void SGXWallet::printUsage() { ...@@ -54,10 +54,10 @@ void SGXWallet::printUsage() {
cerr << "\nBackup, restore, update flags:\n\n"; 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 << " -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 << " -y Do not ask user to acknowledge receipt of the backup key \n";
cerr << "\nHTTPS flags:\n\n"; cerr << "\nSecurity flags flags:\n\n";
cerr << " -n Launch sgxwallet using http. Default is to use https with a selg-signed server cert. \n"; cerr << " -n Use http instead of https. Default is to use https with a selg-signed server cert. Insecure! \n";
cerr << " -c Do not verify SSL client certs\n"; cerr << " -c Disable client authentication using certificates. Insecure!\n";
cerr << " -s Sign SSL client certs without human confirmation \n"; cerr << " -s Sign client certificates without human confirmation. Insecure! \n";
} }
......
...@@ -168,6 +168,11 @@ extern bool autoconfirm; ...@@ -168,6 +168,11 @@ extern bool autoconfirm;
#define ZMQ_NO_SIG_IN_MESSAGE -95 #define ZMQ_NO_SIG_IN_MESSAGE -95
#define ZMQ_NO_CERT_IN_MESSAGE -96 #define ZMQ_NO_CERT_IN_MESSAGE -96
#define ZMQ_COULD_NOT_VERIFY_SIG -97 #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 #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