diff --git a/src/ripple/app/tests/AmendmentTable.test.cpp b/src/ripple/app/tests/AmendmentTable.test.cpp index e531e83e6f..b8888e9ade 100644 --- a/src/ripple/app/tests/AmendmentTable.test.cpp +++ b/src/ripple/app/tests/AmendmentTable.test.cpp @@ -412,27 +412,27 @@ public: case 0: // amendment goes from majority to enabled if (enabled.find (hash) != enabled.end ()) - throw std::runtime_error ("enabling already enabled"); + Throw ("enabling already enabled"); if (majority.find (hash) == majority.end ()) - throw std::runtime_error ("enabling without majority"); + Throw ("enabling without majority"); enabled.insert (hash); majority.erase (hash); break; case tfGotMajority: if (majority.find (hash) != majority.end ()) - throw std::runtime_error ("got majority while having majority"); + Throw ("got majority while having majority"); majority[hash] = roundTime; break; case tfLostMajority: if (majority.find (hash) == majority.end ()) - throw std::runtime_error ("lost majority without majority"); + Throw ("lost majority without majority"); majority.erase (hash); break; default: - throw std::runtime_error ("unknown action"); + Throw ("unknown action"); } } } diff --git a/src/ripple/server/impl/Port.cpp b/src/ripple/server/impl/Port.cpp index 5bccd6356c..3e93a4c303 100644 --- a/src/ripple/server/impl/Port.cpp +++ b/src/ripple/server/impl/Port.cpp @@ -101,7 +101,7 @@ populate (Section const& section, std::string const& field, std::ostream& log, log << "0.0.0.0 not allowed'" << "' for key '" << field << "' in [" << section.name () << "]\n"; - throw std::exception (); + Throw (); } else { @@ -127,7 +127,7 @@ populate (Section const& section, std::string const& field, std::ostream& log, { log << "IP specified for " << field << " is also for " << "admin: " << ip << " in [" << section.name() << "]\n"; - throw std::exception(); + Throw (); } ips->emplace_back (addr.first.address ()); diff --git a/src/ripple/test/impl/JSONRPCClient.cpp b/src/ripple/test/impl/JSONRPCClient.cpp index a8720e5408..e5b946056b 100644 --- a/src/ripple/test/impl/JSONRPCClient.cpp +++ b/src/ripple/test/impl/JSONRPCClient.cpp @@ -52,7 +52,8 @@ class JSONRPCClient : public AbstractClient *pp.ip = address_v4{0x7f000001}; return { *pp.ip, *pp.port }; } - throw std::runtime_error("Missing HTTP port"); + Throw("Missing HTTP port"); + return {}; // Silence compiler control paths return value warning } template @@ -133,7 +134,8 @@ public: { auto const result = p.write(bin_.data()); if (result.first) - throw result.first; + Throw(result.first); + bin_.consume(result.second); if(p.complete()) break; diff --git a/src/ripple/test/impl/WSClient.cpp b/src/ripple/test/impl/WSClient.cpp index 6b0d426ab0..b51c456cc5 100644 --- a/src/ripple/test/impl/WSClient.cpp +++ b/src/ripple/test/impl/WSClient.cpp @@ -136,7 +136,8 @@ class WSClientImpl : public WSClient *pp.ip = address_v4{0x7f000001}; return { *pp.ip, *pp.port }; } - throw std::runtime_error("Missing WebSocket port"); + Throw("Missing WebSocket port"); + return {}; // Silence compiler control paths return value warning } template @@ -181,7 +182,8 @@ public: error_code ec; ws_.connect(ec); if(ec) - throw ec; + Throw(ec); + read_frame_op{*this}; }