diff --git a/src/CryptoNoteCore/BlockIndex.cpp b/src/CryptoNoteCore/BlockIndex.cpp index 2e6b5544..be08bd0b 100644 --- a/src/CryptoNoteCore/BlockIndex.cpp +++ b/src/CryptoNoteCore/BlockIndex.cpp @@ -48,7 +48,7 @@ namespace cn { { assert(m_index.count(startBlockId) > 0); - uint32_t startBlockHeight; + uint32_t startBlockHeight = 0; std::vector result; if (getBlockHeight(startBlockId, startBlockHeight)) { diff --git a/src/NodeRpcProxy/NodeRpcProxy.cpp b/src/NodeRpcProxy/NodeRpcProxy.cpp index 72dd833d..01e4323e 100644 --- a/src/NodeRpcProxy/NodeRpcProxy.cpp +++ b/src/NodeRpcProxy/NodeRpcProxy.cpp @@ -153,7 +153,9 @@ void NodeRpcProxy::workerThread(const INode::Callback& initialized_callback) { contextGroup.wait(); // Make sure all remote spawns are executed m_dispatcher->yield(); - } catch (std::exception&) { + } catch (std::exception& e) { + // TODO Make this pass through file log + std::cout << "Exception while attempting to make a worker thread: " << e.what(); } m_dispatcher = nullptr; diff --git a/src/Rpc/HttpClient.cpp b/src/Rpc/HttpClient.cpp index 74b89864..de38ca47 100644 --- a/src/Rpc/HttpClient.cpp +++ b/src/Rpc/HttpClient.cpp @@ -70,14 +70,14 @@ void HttpClient::disconnect() { m_streamBuf.reset(); try { m_connection.write(nullptr, 0); //Socket shutdown. - } catch (std::exception&) { - //Ignoring possible exception. + } catch (std::exception& e) { + throw ConnectException(e.what()); } try { m_connection = platform_system::TcpConnection(); - } catch (std::exception&) { - //Ignoring possible exception. + } catch (std::exception& e) { + throw ConnectException(e.what()); } m_connected = false; diff --git a/src/Rpc/HttpServer.cpp b/src/Rpc/HttpServer.cpp index f0bebea5..a3e7709e 100644 --- a/src/Rpc/HttpServer.cpp +++ b/src/Rpc/HttpServer.cpp @@ -69,8 +69,8 @@ void HttpServer::acceptLoop() { accepted = true; } catch (platform_system::InterruptedException&) { throw; - } catch (std::exception&) { - // try again + } catch (std::exception& e) { + logger(WARNING) << "Exception while trying to accept the loop, trying again."; } } @@ -120,6 +120,7 @@ void HttpServer::acceptLoop() { logger(DEBUGGING) << "Closing connection from " << addr.first.toDottedDecimal() << ":" << addr.second << " total=" << m_connections.size(); } catch (platform_system::InterruptedException&) { + throw; } catch (std::exception& e) { logger(DEBUGGING) << "Connection error: " << e.what(); } diff --git a/src/Wallet/WalletGreen.cpp b/src/Wallet/WalletGreen.cpp index 86f1ace6..d1af2d7c 100644 --- a/src/Wallet/WalletGreen.cpp +++ b/src/Wallet/WalletGreen.cpp @@ -2817,6 +2817,7 @@ namespace cn } catch (...) { + m_logger(WARNING, BRIGHT_RED) << "Rollback has failed. The TX will be stored as unconfirmed and will be deleted after the wallet is relaunched during TX pool sync."; // Ignore any exceptions. If rollback fails then the transaction is stored as unconfirmed and will be deleted after wallet relaunch // during transaction pool synchronization } diff --git a/src/WalletLegacy/WalletLegacy.cpp b/src/WalletLegacy/WalletLegacy.cpp index 5b23fa60..89e1d42a 100644 --- a/src/WalletLegacy/WalletLegacy.cpp +++ b/src/WalletLegacy/WalletLegacy.cpp @@ -269,8 +269,10 @@ void WalletLegacy::doLoad(std::istream& source) { std::stringstream stream(cache); m_transfersSync.load(stream); } - } catch (const std::exception&) { + } catch (const std::exception& e) { + // TODO Make this pass through file log at some point // ignore cache loading errors + std::cout << "Exception during loading cache: " << e.what() << std::endl; } // Read all output keys cache std::vector allTransfers;