diff --git a/Builds/VisualStudio2015/RippleD.vcxproj b/Builds/VisualStudio2015/RippleD.vcxproj
index 5dac8331b..02000b7fe 100644
--- a/Builds/VisualStudio2015/RippleD.vcxproj
+++ b/Builds/VisualStudio2015/RippleD.vcxproj
@@ -1980,6 +1980,10 @@
True
True
+
+ True
+ True
+
True
True
diff --git a/Builds/VisualStudio2015/RippleD.vcxproj.filters b/Builds/VisualStudio2015/RippleD.vcxproj.filters
index 4d725047a..cc6d5a1f7 100644
--- a/Builds/VisualStudio2015/RippleD.vcxproj.filters
+++ b/Builds/VisualStudio2015/RippleD.vcxproj.filters
@@ -2718,6 +2718,9 @@
ripple\basics\tests
+
+ ripple\basics\tests
+
ripple\basics\tests
diff --git a/src/ripple/app/ledger/ConsensusTransSetSF.cpp b/src/ripple/app/ledger/ConsensusTransSetSF.cpp
index 374bc43ac..6f862934a 100644
--- a/src/ripple/app/ledger/ConsensusTransSetSF.cpp
+++ b/src/ripple/app/ledger/ConsensusTransSetSF.cpp
@@ -67,7 +67,7 @@ void ConsensusTransSetSF::gotNode (
pap->getOPs().submitTransaction(stx);
});
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j_.warning)
<< "Fetched invalid transaction in proposed set";
diff --git a/src/ripple/app/ledger/Ledger.cpp b/src/ripple/app/ledger/Ledger.cpp
index 74c623b89..d210ef64d 100644
--- a/src/ripple/app/ledger/Ledger.cpp
+++ b/src/ripple/app/ledger/Ledger.cpp
@@ -243,7 +243,7 @@ Ledger::Ledger (uint256 const& parentHash,
if (! setup(config))
loaded = false;
-
+
if (! loaded)
{
updateHash ();
@@ -456,7 +456,7 @@ deserializeTxPlusMeta (SHAMapItem const& item)
void Ledger::setAcquiring (void)
{
if (!txMap_ || !stateMap_)
- throw std::runtime_error ("invalid map");
+ Throw ("invalid map");
txMap_->setSynching ();
stateMap_->setSynching ();
@@ -721,12 +721,11 @@ Ledger::setup (Config const& config)
{
ret = false;
}
- catch (...)
+ catch (std::exception const&)
{
- throw;
+ Throw();
}
-
try
{
rules_ = Rules(*this);
@@ -735,9 +734,9 @@ Ledger::setup (Config const& config)
{
ret = false;
}
- catch (...)
+ catch (std::exception const&)
{
- throw;
+ Throw();
}
return ret;
@@ -783,7 +782,7 @@ void Ledger::visitStateItems (std::function callback) const
catch (SHAMapMissingNode&)
{
stateMap_->family().missing_node (info_.hash);
- throw;
+ Throw();
}
}
@@ -999,7 +998,7 @@ static bool saveValidatedLedger (
app.getAcceptedLedgerCache().canonicalize(ledger->info().hash, aLedger);
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j.warning) << "An accepted ledger was missing nodes";
app.getLedgerMaster().failedSave(seq, ledger->info().hash);
diff --git a/src/ripple/app/ledger/OpenLedger.h b/src/ripple/app/ledger/OpenLedger.h
index a77856dd8..fd8f90c8c 100644
--- a/src/ripple/app/ledger/OpenLedger.h
+++ b/src/ripple/app/ledger/OpenLedger.h
@@ -224,7 +224,7 @@ OpenLedger::apply (Application& app, OpenView& view,
if (result == Result::retry)
retries.insert(tx);
}
- catch(...)
+ catch(std::exception const&)
{
JLOG(j.error) <<
"Caught exception";
diff --git a/src/ripple/app/ledger/OrderBookDB.cpp b/src/ripple/app/ledger/OrderBookDB.cpp
index 103c2de2c..a54b7be24 100644
--- a/src/ripple/app/ledger/OrderBookDB.cpp
+++ b/src/ripple/app/ledger/OrderBookDB.cpp
@@ -282,7 +282,7 @@ void OrderBookDB::processTxn (
}
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j_.info)
<< "Fields not found in OrderBookDB::processTxn";
diff --git a/src/ripple/app/ledger/impl/InboundLedgers.cpp b/src/ripple/app/ledger/impl/InboundLedgers.cpp
index 258e9b3cc..4c6e64e63 100644
--- a/src/ripple/app/ledger/impl/InboundLedgers.cpp
+++ b/src/ripple/app/ledger/impl/InboundLedgers.cpp
@@ -271,7 +271,7 @@ public:
newNode->getNodeHash().as_uint256(), blob);
}
}
- catch (...)
+ catch (std::exception const&)
{
}
}
diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp
index 16d048772..ff06a209a 100644
--- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp
+++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp
@@ -35,6 +35,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -531,7 +532,7 @@ void LedgerConsensusImp::mapComplete (
leaveConsensus();
JLOG (j_.error) <<
"Missing node processing complete map " << mn;
- throw;
+ Throw();
}
}
@@ -731,7 +732,7 @@ void LedgerConsensusImp::timerEntry ()
leaveConsensus ();
JLOG (j_.error) <<
"Missing node during consensus process " << mn;
- throw;
+ Throw();
}
}
@@ -1167,7 +1168,7 @@ void LedgerConsensusImp::accept (std::shared_ptr set)
anyDisputes = true;
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j_.debug)
<< "Failed to apply transaction we voted NO on";
@@ -1857,7 +1858,7 @@ applyTransaction (Application& app, OpenView& view,
<< "Transaction retry: " << transHuman (result.first);
return LedgerConsensusImp::resultRetry;
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j.warning) << "Throws";
return LedgerConsensusImp::resultFail;
@@ -1889,7 +1890,7 @@ void applyTransactions (
{
txn = std::make_shared(SerialIter{item.slice()});
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j.warning) << " Throws";
}
@@ -1933,7 +1934,7 @@ void applyTransactions (
++it;
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j.warning)
<< "Transaction throws";
diff --git a/src/ripple/app/ledger/impl/LedgerMaster.cpp b/src/ripple/app/ledger/impl/LedgerMaster.cpp
index 68d83c805..1e30369ee 100644
--- a/src/ripple/app/ledger/impl/LedgerMaster.cpp
+++ b/src/ripple/app/ledger/impl/LedgerMaster.cpp
@@ -629,7 +629,7 @@ public:
{
hash = hashOfSeq(*ledger, lSeq, m_journal);
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (m_journal.warning) <<
"fixMismatch encounters partial ledger";
@@ -984,7 +984,7 @@ public:
{
doAdvance();
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (m_journal.fatal) << "doAdvance throws an exception";
}
@@ -1106,7 +1106,7 @@ public:
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (m_journal.error)
<< "findNewLedgersToPublish catches an exception";
@@ -1501,7 +1501,7 @@ public:
if (hash)
return mLedgerHistory.getLedgerByHash (*hash);
}
- catch (...)
+ catch (std::exception const&)
{
// Missing nodes are already handled
}
@@ -1734,7 +1734,7 @@ void LedgerMasterImp::doAdvance ()
InboundLedger::fcHISTORY);
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (m_journal.warning) <<
"Threw while prefetching";
@@ -1962,7 +1962,7 @@ void LedgerMasterImp::makeFetchPack (
auto msg = std::make_shared (reply, protocol::mtGET_OBJECTS);
peer->send (msg);
}
- catch (...)
+ catch (std::exception const&)
{
m_journal.warning << "Exception building fetch pach";
}
diff --git a/src/ripple/app/ledger/impl/LedgerToJson.cpp b/src/ripple/app/ledger/impl/LedgerToJson.cpp
index d7917204d..c55ec83ba 100644
--- a/src/ripple/app/ledger/impl/LedgerToJson.cpp
+++ b/src/ripple/app/ledger/impl/LedgerToJson.cpp
@@ -117,7 +117,7 @@ void fillJsonTx (Object& json, LedgerFill const& fill)
}
}
}
- catch (...)
+ catch (std::exception const&)
{
// Nothing the user can do about this.
}
diff --git a/src/ripple/app/ledger/impl/OpenLedger.cpp b/src/ripple/app/ledger/impl/OpenLedger.cpp
index 9713853de..a73d8ec3b 100644
--- a/src/ripple/app/ledger/impl/OpenLedger.cpp
+++ b/src/ripple/app/ledger/impl/OpenLedger.cpp
@@ -184,7 +184,7 @@ debugTostr (SHAMap const& set)
STTx const>(sit);
ss << debugTxstr(tx) << ", ";
}
- catch(...)
+ catch(std::exception const&)
{
ss << "THRO, ";
}
diff --git a/src/ripple/app/ledger/impl/TransactionAcquire.cpp b/src/ripple/app/ledger/impl/TransactionAcquire.cpp
index fe2dfbabc..839a1cb87 100644
--- a/src/ripple/app/ledger/impl/TransactionAcquire.cpp
+++ b/src/ripple/app/ledger/impl/TransactionAcquire.cpp
@@ -226,7 +226,7 @@ SHAMapAddNode TransactionAcquire::takeNodes (const std::list& node
progress ();
return SHAMapAddNode::useful ();
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j_.error) << "Peer sends us junky transaction node data";
return SHAMapAddNode::invalid ();
diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp
index eb2803bc6..a37a2ec01 100644
--- a/src/ripple/app/main/Application.cpp
+++ b/src/ripple/app/main/Application.cpp
@@ -46,6 +46,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -1047,7 +1048,7 @@ void ApplicationImp::setup()
{
m_journal.fatal << "Could not create Websocket for [" <<
port.name << "]";
- throw std::exception();
+ Throw ();
}
websocketServers_.emplace_back (std::move (server));
}
@@ -1526,7 +1527,7 @@ static bool schemaHas (
if (static_cast (schema.size ()) <= line)
{
JLOG (j.fatal) << "Schema for " << dbName << " has too few lines";
- throw std::runtime_error ("bad schema");
+ Throw ("bad schema");
}
return schema[line].find (content) != std::string::npos;
diff --git a/src/ripple/app/main/LocalCredentials.cpp b/src/ripple/app/main/LocalCredentials.cpp
index 84c7a4902..c17f8100f 100644
--- a/src/ripple/app/main/LocalCredentials.cpp
+++ b/src/ripple/app/main/LocalCredentials.cpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -46,7 +47,7 @@ void LocalCredentials::start ()
nodeIdentityCreate ();
if (!nodeIdentityLoad ())
- throw std::runtime_error ("unable to retrieve new node identity.");
+ Throw ("unable to retrieve new node identity.");
}
if (!app_.config().QUIET)
diff --git a/src/ripple/app/main/Main.cpp b/src/ripple/app/main/Main.cpp
index e42614a67..8eb7a3c42 100644
--- a/src/ripple/app/main/Main.cpp
+++ b/src/ripple/app/main/Main.cpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -298,7 +299,7 @@ int run (int argc, char** argv)
vm);
po::notify (vm); // Invoke option notify functions.
}
- catch (...)
+ catch (std::exception const&)
{
std::cerr << "rippled: Incorrect command line syntax." << std::endl;
std::cerr << "Use '--help' for a list of options." << std::endl;
@@ -421,7 +422,7 @@ int run (int argc, char** argv)
boost::asio::ip::address_v4::from_string(
vm["rpc_ip"].as()));
}
- catch(...)
+ catch(std::exception const&)
{
std::cerr << "Invalid rpc_ip = " <<
vm["rpc_ip"].as() << std::endl;
@@ -439,9 +440,9 @@ int run (int argc, char** argv)
vm["rpc_port"].as());
if (*config->rpc_port == 0)
- throw std::domain_error ("");
+ Throw ("");
}
- catch(...)
+ catch(std::exception const&)
{
std::cerr << "Invalid rpc_port = " <<
vm["rpc_port"].as() << std::endl;
@@ -457,9 +458,9 @@ int run (int argc, char** argv)
config->LOCK_QUORUM = true;
if (config->VALIDATION_QUORUM < 0)
- throw std::domain_error ("");
+ Throw ("");
}
- catch(...)
+ catch(std::exception const&)
{
std::cerr << "Invalid quorum = " <<
vm["quorum"].as () << std::endl;
diff --git a/src/ripple/app/misc/AmendmentTableImpl.cpp b/src/ripple/app/misc/AmendmentTableImpl.cpp
index ae2ee4c72..5097bf1e0 100644
--- a/src/ripple/app/misc/AmendmentTableImpl.cpp
+++ b/src/ripple/app/misc/AmendmentTableImpl.cpp
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -135,7 +136,7 @@ AmendmentTableImpl::addInitial (Section const& section)
"preEnabledAmendments contains an invalid hash (expected "
"a hex number). Value was: %1%") %
a.hexString ()).str ();
- throw std::runtime_error (errorMsg);
+ Throw (errorMsg);
}
}
@@ -157,7 +158,7 @@ AmendmentTableImpl::addInitial (Section const& section)
"items. Found %3%. Line was: %4%") %
SECTION_AMENDMENTS % numExpectedToks % tokens.size () %
line).str ();
- throw std::runtime_error (errorMsg);
+ Throw (errorMsg);
}
toAdd.emplace_back (std::move (tokens[0]), std::move (tokens[1]));
@@ -170,7 +171,7 @@ AmendmentTableImpl::addInitial (Section const& section)
"%3%") %
toAdd.back ().hexString () % SECTION_AMENDMENTS %
line).str ();
- throw std::runtime_error (errorMsg);
+ Throw (errorMsg);
}
}
}
@@ -233,7 +234,7 @@ AmendmentTableImpl::addKnown (AmendmentName const& name)
"addKnown was given an invalid hash (expected a hex number). "
"Value was: %1%") %
name.hexString ()).str ();
- throw std::runtime_error (errorMsg);
+ Throw (errorMsg);
}
std::lock_guard sl (mLock);
diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp
index eb7673c94..eb999dbea 100644
--- a/src/ripple/app/misc/NetworkOPs.cpp
+++ b/src/ripple/app/misc/NetworkOPs.cpp
@@ -43,6 +43,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -767,7 +768,7 @@ void NetworkOPsImp::submitTransaction (std::shared_ptr const& iTrans
return;
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG(m_journal.warning) << "Exception checking transaction" << txid;
@@ -1259,7 +1260,7 @@ bool NetworkOPsImp::checkLastClosedLedger (
++vc.nodesUsing;
}
- catch (...)
+ catch (std::exception const&)
{
// Peer is likely not connected anymore
}
@@ -2539,7 +2540,7 @@ std::uint32_t NetworkOPsImp::acceptLedger ()
assert (m_standalone);
if (!m_standalone)
- throw std::runtime_error ("Operation only possible in STANDALONE mode.");
+ Throw ("Operation only possible in STANDALONE mode.");
// FIXME Could we improve on this and remove the need for a specialized
// API in LedgerConsensus?
diff --git a/src/ripple/app/misc/SHAMapStoreImp.cpp b/src/ripple/app/misc/SHAMapStoreImp.cpp
index c99bdc484..50b26fd54 100644
--- a/src/ripple/app/misc/SHAMapStoreImp.cpp
+++ b/src/ripple/app/misc/SHAMapStoreImp.cpp
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -62,7 +63,7 @@ void SHAMapStoreImp::SavedStateDB::init (BasicConfig const& config,
"SELECT COUNT(Key) FROM DbState WHERE Key = 1;"
, soci::into (countO);
if (!countO)
- throw std::runtime_error("Failed to fetch Key Count from DbState.");
+ Throw ("Failed to fetch Key Count from DbState.");
count = *countO;
}
@@ -79,7 +80,7 @@ void SHAMapStoreImp::SavedStateDB::init (BasicConfig const& config,
"SELECT COUNT(Key) FROM CanDelete WHERE Key = 1;"
, soci::into (countO);
if (!countO)
- throw std::runtime_error("Failed to fetch Key Count from CanDelete.");
+ Throw ("Failed to fetch Key Count from CanDelete.");
count = *countO;
}
@@ -185,13 +186,13 @@ SHAMapStoreImp::SHAMapStoreImp (
{
if (setup_.deleteInterval < minimumDeletionInterval_)
{
- throw std::runtime_error ("online_delete must be at least " +
+ Throw ("online_delete must be at least " +
std::to_string (minimumDeletionInterval_));
}
if (setup_.ledgerHistory > setup_.deleteInterval)
{
- throw std::runtime_error (
+ Throw (
"online_delete must be less than ledger_history (currently " +
std::to_string (setup_.ledgerHistory) + ")");
}
@@ -419,7 +420,7 @@ SHAMapStoreImp::dbPaths()
{
std::cerr << "node db path must be a directory. "
<< dbPath.string();
- throw std::runtime_error (
+ Throw (
"node db path must be a directory.");
}
}
@@ -465,7 +466,7 @@ SHAMapStoreImp::dbPaths()
<< get(setup_.nodeDatabase, "path")
<< std::endl;
- throw std::runtime_error ("state db error");
+ Throw ("state db error");
}
}
diff --git a/src/ripple/app/misc/UniqueNodeList.cpp b/src/ripple/app/misc/UniqueNodeList.cpp
index d584b3af8..5b5a04677 100644
--- a/src/ripple/app/misc/UniqueNodeList.cpp
+++ b/src/ripple/app/misc/UniqueNodeList.cpp
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -861,7 +862,7 @@ int UniqueNodeListImp::iSourceScore (ValidatorSource vsWhy)
break;
default:
- throw std::runtime_error ("Internal error: bad ValidatorSource.");
+ Throw ("Internal error: bad ValidatorSource.");
}
return iScore;
diff --git a/src/ripple/app/misc/impl/AccountTxPaging.cpp b/src/ripple/app/misc/impl/AccountTxPaging.cpp
index 977842577..3733d9f2f 100644
--- a/src/ripple/app/misc/impl/AccountTxPaging.cpp
+++ b/src/ripple/app/misc/impl/AccountTxPaging.cpp
@@ -106,7 +106,7 @@ accountTxPage (
findLedger = token[jss::ledger].asInt();
findSeq = token[jss::seq].asInt();
}
- catch (...)
+ catch (std::exception const&)
{
return;
}
diff --git a/src/ripple/app/misc/impl/Transaction.cpp b/src/ripple/app/misc/impl/Transaction.cpp
index eae6ff14c..629bf6d34 100644
--- a/src/ripple/app/misc/impl/Transaction.cpp
+++ b/src/ripple/app/misc/impl/Transaction.cpp
@@ -47,11 +47,6 @@ Transaction::Transaction (std::shared_ptr const& stx,
reason = e.what();
return;
}
- catch (...)
- {
- reason = "Unexpected exception";
- return;
- }
mStatus = NEW;
}
diff --git a/src/ripple/app/paths/Pathfinder.cpp b/src/ripple/app/paths/Pathfinder.cpp
index c483a9054..81bde1609 100644
--- a/src/ripple/app/paths/Pathfinder.cpp
+++ b/src/ripple/app/paths/Pathfinder.cpp
@@ -439,7 +439,7 @@ void Pathfinder::computePathRanks (int maxPaths)
<< "Default path fails: " << transToken (rc.result ());
}
}
- catch (...)
+ catch (std::exception const&)
{
JLOG (j_.debug) << "Default path causes exception";
}
diff --git a/src/ripple/app/paths/cursor/NextIncrement.cpp b/src/ripple/app/paths/cursor/NextIncrement.cpp
index 4dbbdb01d..7d555bc31 100644
--- a/src/ripple/app/paths/cursor/NextIncrement.cpp
+++ b/src/ripple/app/paths/cursor/NextIncrement.cpp
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
namespace ripple {
@@ -54,7 +55,7 @@ void PathCursor::nextIncrement () const
<< " inPass()=" << pathState_.inPass();
if (isDry)
- throw std::runtime_error ("Made no progress.");
+ Throw ("Made no progress.");
// Calculate relative quality.
pathState_.setQuality(getRate (
diff --git a/src/ripple/app/tests/AmendmentTable.test.cpp b/src/ripple/app/tests/AmendmentTable.test.cpp
index a8345b13e..0ac338807 100644
--- a/src/ripple/app/tests/AmendmentTable.test.cpp
+++ b/src/ripple/app/tests/AmendmentTable.test.cpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -196,7 +197,7 @@ public:
// line above should throw
fail ("didn't throw");
}
- catch (...)
+ catch (std::exception const&)
{
pass ();
}
@@ -207,7 +208,7 @@ public:
// line above should throw
fail ("didn't throw");
}
- catch (...)
+ catch (std::exception const&)
{
pass ();
}
@@ -233,7 +234,7 @@ public:
// line above should throw
fail ("didn't throw");
}
- catch (...)
+ catch (std::exception const&)
{
pass ();
}
@@ -243,7 +244,7 @@ public:
// line above should throw
fail ("didn't throw");
}
- catch (...)
+ catch (std::exception const&)
{
pass ();
}
@@ -457,28 +458,28 @@ 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:
assert (false);
- throw std::runtime_error ("unknown action");
+ Throw ("unknown action");
}
}
}
diff --git a/src/ripple/app/tests/Path_test.cpp b/src/ripple/app/tests/Path_test.cpp
index 39be3d9c3..153ba3510 100644
--- a/src/ripple/app/tests/Path_test.cpp
+++ b/src/ripple/app/tests/Path_test.cpp
@@ -18,6 +18,8 @@
//==============================================================================
#include
+#include
+#include
#include
#include
#include
@@ -26,7 +28,6 @@
#include
#include
#include
-#include
namespace ripple {
namespace test {
@@ -158,7 +159,7 @@ find_paths(jtx::Env& env,
level, saSendMax, convert_all, env.app());
if (! result.first)
{
- throw std::runtime_error(
+ Throw (
"Path_test::findPath: ripplePathFind find failed");
}
auto const& jv = result.second[0u];
diff --git a/src/ripple/app/tx/impl/CreateOffer.cpp b/src/ripple/app/tx/impl/CreateOffer.cpp
index b89078564..d81d1500e 100644
--- a/src/ripple/app/tx/impl/CreateOffer.cpp
+++ b/src/ripple/app/tx/impl/CreateOffer.cpp
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -322,7 +323,7 @@ CreateOffer::bridged_cross (
assert (!isXRP (taker_amount.in) && !isXRP (taker_amount.out));
if (isXRP (taker_amount.in) || isXRP (taker_amount.out))
- throw std::logic_error ("Bridging with XRP and an endpoint.");
+ Throw ("Bridging with XRP and an endpoint.");
OfferStream offers_direct (view, view_cancel,
Book (taker.issue_in (), taker.issue_out ()),
@@ -461,7 +462,7 @@ CreateOffer::bridged_cross (
assert (direct_consumed || leg1_consumed || leg2_consumed);
if (!direct_consumed && !leg1_consumed && !leg2_consumed)
- throw std::logic_error ("bridged crossing: nothing was fully consumed.");
+ Throw ("bridged crossing: nothing was fully consumed.");
}
return std::make_pair(cross_result, taker.remaining_offer ());
@@ -542,7 +543,7 @@ CreateOffer::direct_cross (
assert (direct_consumed);
if (!direct_consumed)
- throw std::logic_error ("direct crossing: nothing was fully consumed.");
+ Throw ("direct crossing: nothing was fully consumed.");
}
return std::make_pair(cross_result, taker.remaining_offer ());
@@ -601,11 +602,6 @@ CreateOffer::cross (
j_.error << "Exception during offer crossing: " << e.what ();
return std::make_pair (tecINTERNAL, taker.remaining_offer ());
}
- catch (...)
- {
- j_.error << "Exception during offer crossing.";
- return std::make_pair (tecINTERNAL, taker.remaining_offer ());
- }
}
std::string
diff --git a/src/ripple/app/tx/impl/Offer.h b/src/ripple/app/tx/impl/Offer.h
index c0d88ac12..215e1a864 100644
--- a/src/ripple/app/tx/impl/Offer.h
+++ b/src/ripple/app/tx/impl/Offer.h
@@ -20,6 +20,7 @@
#ifndef RIPPLE_APP_BOOK_OFFER_H_INCLUDED
#define RIPPLE_APP_BOOK_OFFER_H_INCLUDED
+#include
#include
#include
#include
@@ -99,10 +100,10 @@ public:
Amounts const& consumed) const
{
if (consumed.in > m_amounts.in)
- throw std::logic_error ("can't consume more than is available.");
+ Throw ("can't consume more than is available.");
if (consumed.out > m_amounts.out)
- throw std::logic_error ("can't produce more than is available.");
+ Throw ("can't produce more than is available.");
m_amounts.in -= consumed.in;
m_amounts.out -= consumed.out;
diff --git a/src/ripple/app/tx/impl/Taker.cpp b/src/ripple/app/tx/impl/Taker.cpp
index 3f004a111..399a2cd10 100644
--- a/src/ripple/app/tx/impl/Taker.cpp
+++ b/src/ripple/app/tx/impl/Taker.cpp
@@ -19,6 +19,7 @@
#include
#include
+#include
namespace ripple {
@@ -401,7 +402,7 @@ BasicTaker::do_cross (Amounts offer, Quality quality, AccountID const& owner)
}
if (!result.sanity_check ())
- throw std::logic_error ("Computed flow fails sanity check.");
+ Throw ("Computed flow fails sanity check.");
remaining_.out -= result.order.out;
remaining_.in -= result.order.in;
@@ -476,12 +477,12 @@ BasicTaker::do_cross (
auto flow1 = flow_iou_to_xrp (offer1, quality1, xrp_funds, leg1_in_funds, leg1_rate);
if (!flow1.sanity_check ())
- throw std::logic_error ("Computed flow1 fails sanity check.");
+ Throw ("Computed flow1 fails sanity check.");
auto flow2 = flow_xrp_to_iou (offer2, quality2, leg2_out_funds, xrp_funds, leg2_rate);
if (!flow2.sanity_check ())
- throw std::logic_error ("Computed flow2 fails sanity check.");
+ Throw ("Computed flow2 fails sanity check.");
// We now have the maximal flows across each leg individually. We need to
// equalize them, so that the amount of XRP that flows out of the first leg
@@ -505,7 +506,7 @@ BasicTaker::do_cross (
}
if (flow1.order.out != flow2.order.in)
- throw std::logic_error ("Bridged flow is out of balance.");
+ Throw ("Bridged flow is out of balance.");
remaining_.out -= flow2.order.out;
remaining_.in -= flow1.order.in;
@@ -555,10 +556,10 @@ void
Taker::consume_offer (Offer const& offer, Amounts const& order)
{
if (order.in < zero)
- throw std::logic_error ("flow with negative input.");
+ Throw ("flow with negative input.");
if (order.out < zero)
- throw std::logic_error ("flow with negative output.");
+ Throw ("flow with negative output.");
if (journal_.debug) journal_.debug << "Consuming from offer " << offer;
@@ -585,7 +586,7 @@ TER Taker::transferXRP (
STAmount const& amount)
{
if (!isXRP (amount))
- throw std::logic_error ("Using transferXRP with IOU");
+ Throw ("Using transferXRP with IOU");
if (from == to)
return tesSUCCESS;
@@ -603,7 +604,7 @@ TER Taker::redeemIOU (
Issue const& issue)
{
if (isXRP (amount))
- throw std::logic_error ("Using redeemIOU with XRP");
+ Throw ("Using redeemIOU with XRP");
if (account == issue.account)
return tesSUCCESS;
@@ -615,12 +616,12 @@ TER Taker::redeemIOU (
// If we are trying to redeem some amount, then the account
// must have a credit balance.
if (get_funds (account, amount) <= zero)
- throw std::logic_error ("redeemIOU has no funds to redeem");
+ Throw ("redeemIOU has no funds to redeem");
auto ret = ripple::redeemIOU (view_, account, amount, issue, journal_);
if (get_funds (account, amount) < zero)
- throw std::logic_error ("redeemIOU redeemed more funds than available");
+ Throw ("redeemIOU redeemed more funds than available");
return ret;
}
@@ -631,7 +632,7 @@ TER Taker::issueIOU (
Issue const& issue)
{
if (isXRP (amount))
- throw std::logic_error ("Using issueIOU with XRP");
+ Throw ("Using issueIOU with XRP");
if (account == issue.account)
return tesSUCCESS;
diff --git a/src/ripple/app/tx/impl/Transactor.cpp b/src/ripple/app/tx/impl/Transactor.cpp
index 00732b2c9..647896540 100644
--- a/src/ripple/app/tx/impl/Transactor.cpp
+++ b/src/ripple/app/tx/impl/Transactor.cpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -671,7 +672,7 @@ Transactor::operator()()
{
// VFALCO Log to journal here
// JLOG(journal.fatal) << "invalid fee";
- throw std::logic_error("amount is negative!");
+ Throw ("amount is negative!");
}
if (fee != zero)
diff --git a/src/ripple/app/tx/impl/applySteps.cpp b/src/ripple/app/tx/impl/applySteps.cpp
index 11dc1b702..34599cdb5 100644
--- a/src/ripple/app/tx/impl/applySteps.cpp
+++ b/src/ripple/app/tx/impl/applySteps.cpp
@@ -199,12 +199,6 @@ preflight(Application& app, Rules const& rules,
"apply: " << e.what();
return{ pfctx, tefEXCEPTION };
}
- catch (...)
- {
- JLOG(j.fatal) <<
- "apply: ";
- return{ pfctx, tefEXCEPTION };
- }
}
PreclaimResult
@@ -238,12 +232,6 @@ preclaim (PreflightResult const& preflightResult,
"apply: " << e.what();
return{ *ctx, tefEXCEPTION, 0 };
}
- catch (...)
- {
- JLOG(ctx->j.fatal) <<
- "apply: ";
- return{ *ctx, tefEXCEPTION, 0 };
- }
}
std::uint64_t
@@ -283,12 +271,6 @@ doApply(PreclaimResult const& preclaimResult,
"apply: " << e.what();
return { tefEXCEPTION, false };
}
- catch (...)
- {
- JLOG(preclaimResult.j.fatal) <<
- "apply: ";
- return { tefEXCEPTION, false };
- }
}
} // ripple
\ No newline at end of file
diff --git a/src/ripple/basics/BasicConfig.h b/src/ripple/basics/BasicConfig.h
index c99668618..e540f201b 100644
--- a/src/ripple/basics/BasicConfig.h
+++ b/src/ripple/basics/BasicConfig.h
@@ -20,6 +20,7 @@
#ifndef RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
#define RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
+#include
#include
#include
#include
@@ -104,7 +105,7 @@ public:
if (lines_.empty ())
return "";
else if (lines_.size () > 1)
- throw std::runtime_error (
+ Throw (
"A legacy value must have exactly one line. Section: " + name_);
return lines_[0];
}
@@ -323,7 +324,7 @@ get (Section const& section,
{
return boost::lexical_cast (result.first);
}
- catch(...)
+ catch(std::exception const&)
{
}
return defaultValue;
diff --git a/src/ripple/basics/Slice.h b/src/ripple/basics/Slice.h
index 9572b8450..4ec05155d 100644
--- a/src/ripple/basics/Slice.h
+++ b/src/ripple/basics/Slice.h
@@ -20,6 +20,7 @@
#ifndef RIPPLE_BASICS_SLICE_H_INCLUDED
#define RIPPLE_BASICS_SLICE_H_INCLUDED
+#include
#include
#include
#include
@@ -100,7 +101,7 @@ public:
operator+= (std::size_t n)
{
if (n > size_)
- throw std::domain_error("too small");
+ Throw ("too small");
data_ += n;
size_ -= n;
return *this;
diff --git a/src/ripple/basics/TestSuite.h b/src/ripple/basics/TestSuite.h
index e3b1f8fb3..cb6819a9d 100644
--- a/src/ripple/basics/TestSuite.h
+++ b/src/ripple/basics/TestSuite.h
@@ -110,7 +110,8 @@ public:
try
{
f();
- } catch (...)
+ }
+ catch (std::exception const&)
{
success = true;
}
diff --git a/src/ripple/basics/contract.h b/src/ripple/basics/contract.h
index adfac50a1..7e37da83a 100644
--- a/src/ripple/basics/contract.h
+++ b/src/ripple/basics/contract.h
@@ -22,6 +22,7 @@
#include
#include
+#include
#include
namespace ripple {
@@ -32,22 +33,16 @@ namespace ripple {
preconditions, postconditions, and invariants.
*/
-namespace detail {
-
void
-throwException(
- std::exception_ptr ep);
+Throw ();
-} // detail
-
-template
+template
void
Throw (Args&&... args)
{
- detail::throwException(
- std::make_exception_ptr(
- Exception(std::forward<
- Args>(args)...)));
+ static_assert (std::is_convertible::value,
+ "Exception must derive from std::exception.");
+ throw E(std::forward(args)...);
}
/** Called when faulty logic causes a broken invariant. */
@@ -56,11 +51,6 @@ void
LogicError (
std::string const& how) noexcept;
-/** Called to throw an exception. */
-#ifndef THROW
-#define THROW(T, arg) Throw(arg)
-#endif
-
} // ripple
#endif
diff --git a/src/ripple/basics/impl/CheckLibraryVersions.cpp b/src/ripple/basics/impl/CheckLibraryVersions.cpp
index d7e92627d..afa9833d3 100644
--- a/src/ripple/basics/impl/CheckLibraryVersions.cpp
+++ b/src/ripple/basics/impl/CheckLibraryVersions.cpp
@@ -18,6 +18,7 @@
//==============================================================================
#include
+#include
#include
#include
#include
@@ -58,19 +59,23 @@ std::string openSSLVersion(VersionNumber openSSLVersion)
void checkVersion(std::string name, std::string required, std::string actual)
{
beast::SemanticVersion r, a;
- if (!r.parse(required)) {
- throw std::runtime_error("Didn't understand required version of " +
- name + ": " + required);
- }
- if (!a.parse(actual)) {
- throw std::runtime_error("Didn't understand actual version of " +
- name + ": " + required);
+ if (! r.parse(required))
+ {
+ Throw (
+ "Didn't understand required version of " + name + ": " + required);
}
- if (a < r) {
- throw std::runtime_error("Your " + name + " library is out of date.\n" +
- "Your version: " + actual + "\n" +
- "Required version: " + "\n");
+ if (! a.parse(actual))
+ {
+ Throw (
+ "Didn't understand actual version of " + name + ": " + required);
+ }
+
+ if (a < r)
+ {
+ Throw (
+ "Your " + name + " library is out of date.\n" + "Your version: " +
+ actual + "\nRequired version: " + required + "\n");
}
}
diff --git a/src/ripple/basics/impl/StringUtilities.cpp b/src/ripple/basics/impl/StringUtilities.cpp
index e12a42ec8..1966aa7c9 100644
--- a/src/ripple/basics/impl/StringUtilities.cpp
+++ b/src/ripple/basics/impl/StringUtilities.cpp
@@ -18,6 +18,7 @@
//==============================================================================
#include
+#include
#include
#include
#include
@@ -89,14 +90,14 @@ uint64_t uintFromHex (std::string const& strSrc)
uint64_t uValue (0);
if (strSrc.size () > 16)
- throw std::invalid_argument("overlong 64-bit value");
+ Throw ("overlong 64-bit value");
for (auto c : strSrc)
{
int ret = charUnHex (c);
if (ret == -1)
- throw std::invalid_argument("invalid hex digit");
+ Throw ("invalid hex digit");
uValue = (uValue << 4) | ret;
}
diff --git a/src/ripple/basics/impl/contract.cpp b/src/ripple/basics/impl/contract.cpp
index d30f969f3..13384acf1 100644
--- a/src/ripple/basics/impl/contract.cpp
+++ b/src/ripple/basics/impl/contract.cpp
@@ -36,14 +36,6 @@ accessViolation() noexcept
std::abort ();
}
-// This hook lets you do pre or post
-// processing on exceptions to suit needs.
-void
-throwException (std::exception_ptr ep)
-{
- std::rethrow_exception(ep);
-}
-
} // detail
[[noreturn]]
@@ -53,4 +45,10 @@ LogicError (std::string const&) noexcept
detail::accessViolation();
}
+void
+Throw ()
+{
+ throw;
+}
+
} // ripple
diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp
index 1615c1344..74d753896 100644
--- a/src/ripple/basics/impl/make_SSLContext.cpp
+++ b/src/ripple/basics/impl/make_SSLContext.cpp
@@ -18,8 +18,9 @@
//==============================================================================
#include
-#include
#include
+#include
+#include
#include
#include
#include
@@ -81,9 +82,7 @@ static rsa_ptr rsa_generate_key (int n_bits)
RSA* rsa = RSA_generate_key (n_bits, RSA_F4, nullptr, nullptr);
if (rsa == nullptr)
- {
- throw std::runtime_error ("RSA_generate_key failed");
- }
+ Throw ("RSA_generate_key failed");
return rsa_ptr (rsa);
}
@@ -97,9 +96,7 @@ static evp_pkey_ptr evp_pkey_new()
EVP_PKEY* evp_pkey = EVP_PKEY_new();
if (evp_pkey == nullptr)
- {
- throw std::runtime_error ("EVP_PKEY_new failed");
- }
+ Throw ("EVP_PKEY_new failed");
return evp_pkey_ptr (evp_pkey);
}
@@ -107,9 +104,7 @@ static evp_pkey_ptr evp_pkey_new()
static void evp_pkey_assign_rsa (EVP_PKEY* evp_pkey, rsa_ptr&& rsa)
{
if (! EVP_PKEY_assign_RSA (evp_pkey, rsa.get()))
- {
- throw std::runtime_error ("EVP_PKEY_assign_RSA failed");
- }
+ Throw ("EVP_PKEY_assign_RSA failed");
rsa.release();
}
@@ -123,9 +118,7 @@ static x509_ptr x509_new()
X509* x509 = X509_new();
if (x509 == nullptr)
- {
- throw std::runtime_error ("X509_new failed");
- }
+ Throw ("X509_new failed");
X509_set_version (x509, NID_X509);
@@ -146,25 +139,19 @@ static void x509_set_pubkey (X509* x509, EVP_PKEY* evp_pkey)
static void x509_sign (X509* x509, EVP_PKEY* evp_pkey)
{
if (! X509_sign (x509, evp_pkey, EVP_sha1()))
- {
- throw std::runtime_error ("X509_sign failed");
- }
+ Throw ("X509_sign failed");
}
static void ssl_ctx_use_certificate (SSL_CTX* const ctx, x509_ptr& cert)
{
if (SSL_CTX_use_certificate (ctx, cert.release()) <= 0)
- {
- throw std::runtime_error ("SSL_CTX_use_certificate failed");
- }
+ Throw ("SSL_CTX_use_certificate failed");
}
static void ssl_ctx_use_privatekey (SSL_CTX* const ctx, evp_pkey_ptr& key)
{
if (SSL_CTX_use_PrivateKey (ctx, key.release()) <= 0)
- {
- throw std::runtime_error ("SSL_CTX_use_PrivateKey failed");
- }
+ Throw ("SSL_CTX_use_PrivateKey failed");
}
// track when SSL connections have last negotiated
@@ -406,7 +393,7 @@ initAnonymous (
context.native_handle (),
cipherList.c_str ());
if (result != 1)
- throw std::invalid_argument("SSL_CTX_set_cipher_list failed");
+ Throw ("SSL_CTX_set_cipher_list failed");
using namespace openssl;
@@ -490,7 +477,7 @@ initAuthenticated (boost::asio::ssl::context& context,
fclose (f);
}
- catch (...)
+ catch (std::exception const&)
{
fclose (f);
beast::FatalError ("Reading the SSL chain file generated an exception.",
diff --git a/src/ripple/basics/tests/contract.test.cpp b/src/ripple/basics/tests/contract.test.cpp
new file mode 100644
index 000000000..70cf7e209
--- /dev/null
+++ b/src/ripple/basics/tests/contract.test.cpp
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of rippled: https://github.com/ripple/rippled
+ Copyright (c) 2012, 2013 Ripple Labs Inc.
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#include
+#include
+#include
+#include
+
+namespace ripple {
+
+class contract_test : public beast::unit_test::suite
+{
+public:
+ void run ()
+ {
+ try
+ {
+ Throw("Throw test");
+ }
+ catch (std::runtime_error const& e)
+ {
+ expect(std::string(e.what()) == "Throw test");
+
+ try
+ {
+ Throw();
+ }
+ catch (std::runtime_error const& e)
+ {
+ expect(std::string(e.what()) == "Throw test");
+ }
+ catch (...)
+ {
+ expect(false);
+ }
+ }
+ catch (...)
+ {
+ expect(false);
+ }
+ }
+};
+
+BEAST_DEFINE_TESTSUITE(contract,basics,ripple);
+
+}
diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp
index cb98cacc9..2d1222d15 100644
--- a/src/ripple/core/impl/Config.cpp
+++ b/src/ripple/core/impl/Config.cpp
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -267,7 +268,8 @@ void Config::setup (std::string const& strConf, bool bQuiet)
boost::filesystem::create_directories (CONFIG_DIR, ec);
if (ec)
- throw std::runtime_error (boost::str (boost::format ("Can not create %s") % CONFIG_DIR));
+ Throw (
+ boost::str(boost::format ("Can not create %s") % CONFIG_DIR));
}
}
@@ -285,7 +287,7 @@ void Config::setup (std::string const& strConf, bool bQuiet)
boost::filesystem::create_directories (dataDir, ec);
if (ec)
- throw std::runtime_error (
+ Throw (
boost::str (boost::format ("Can not create %s") % dataDir));
legacy ("database_path", boost::filesystem::absolute (dataDir).string ());
@@ -349,10 +351,11 @@ void Config::loadFromString (std::string const& fileContents)
Json::Reader jrReader;
Json::Value jvCommand;
- if (!jrReader.parse (strJson, jvCommand))
- throw std::runtime_error (
+ if (! jrReader.parse (strJson, jvCommand))
+ Throw (
boost::str (boost::format (
- "Couldn't parse [" SECTION_RPC_STARTUP "] command: %s") % strJson));
+ "Couldn't parse [" SECTION_RPC_STARTUP "] command: %s")
+ % strJson));
RPC_STARTUP.append (jvCommand);
}
diff --git a/src/ripple/core/impl/DatabaseCon.cpp b/src/ripple/core/impl/DatabaseCon.cpp
index 636b5c2a2..d0a388608 100644
--- a/src/ripple/core/impl/DatabaseCon.cpp
+++ b/src/ripple/core/impl/DatabaseCon.cpp
@@ -20,6 +20,7 @@
#include
#include
#include
+#include
#include
#include
@@ -68,7 +69,7 @@ DatabaseCon::Setup setup_DatabaseCon (Config const& c)
void DatabaseCon::setupCheckpointing (JobQueue* q, Logs& l)
{
if (! q)
- throw std::logic_error ("No JobQueue");
+ Throw ("No JobQueue");
checkpointer_ = makeCheckpointer (session_, *q, l);
}
diff --git a/src/ripple/core/impl/DummySociDynamicBackend.cpp b/src/ripple/core/impl/DummySociDynamicBackend.cpp
index a5fdde972..d88bf0557 100644
--- a/src/ripple/core/impl/DummySociDynamicBackend.cpp
+++ b/src/ripple/core/impl/DummySociDynamicBackend.cpp
@@ -25,8 +25,9 @@
*/
#include
-
+#include
#include
+#include
// dummy soci-backend
namespace soci {
@@ -34,7 +35,8 @@ namespace dynamic_backends {
// used internally by session
backend_factory const& get (std::string const& name)
{
- throw std::runtime_error ("Not Supported");
+ ripple::Throw ("Not Supported");
+ return std::ref(soci::sqlite3); // Silence compiler warning.
};
// provided for advanced user-level management
diff --git a/src/ripple/core/impl/LoadFeeTrack.cpp b/src/ripple/core/impl/LoadFeeTrack.cpp
index 7235e6fe5..ec40ca477 100644
--- a/src/ripple/core/impl/LoadFeeTrack.cpp
+++ b/src/ripple/core/impl/LoadFeeTrack.cpp
@@ -18,6 +18,7 @@
//==============================================================================
#include
+#include
#include
#include
#include
@@ -75,7 +76,7 @@ LoadFeeTrack::scaleFeeLoad (std::uint64_t fee, std::uint64_t baseFee,
// If baseFee * feeFactor overflows, the final result will overflow
const auto max = std::numeric_limits::max();
if (baseFee > max / feeFactor)
- throw std::overflow_error("scaleFeeLoad");
+ Throw ("scaleFeeLoad");
baseFee *= feeFactor;
// Reorder fee and baseFee
if (fee < baseFee)
@@ -86,7 +87,7 @@ LoadFeeTrack::scaleFeeLoad (std::uint64_t fee, std::uint64_t baseFee,
// Do the division first, on the larger of fee and baseFee
fee /= den;
if (fee > max / baseFee)
- throw std::overflow_error("scaleFeeLoad");
+ Throw ("scaleFeeLoad");
fee *= baseFee;
}
else
diff --git a/src/ripple/core/impl/SociDB.cpp b/src/ripple/core/impl/SociDB.cpp
index 42f81f96c..6a358f317 100644
--- a/src/ripple/core/impl/SociDB.cpp
+++ b/src/ripple/core/impl/SociDB.cpp
@@ -19,6 +19,7 @@
#include
+#include
#include
#include
#include
@@ -39,9 +40,9 @@ getSociSqliteInit (std::string const& name,
{
if (dir.empty () || name.empty ())
{
- throw std::runtime_error (
+ Throw (
"Sqlite databases must specify a dir and a name. Name: " +
- name + " Dir: " + dir);
+ name + " Dir: " + dir);
}
boost::filesystem::path file (dir);
if (is_directory (file))
@@ -57,7 +58,7 @@ getSociInit (BasicConfig const& config,
auto const backendName = get(section, "backend", "sqlite");
if (backendName != "sqlite")
- throw std::runtime_error ("Unsupported soci backend: " + backendName);
+ Throw ("Unsupported soci backend: " + backendName);
auto const path = config.legacy ("database_path");
auto const ext = dbName == "validators" || dbName == "peerfinder"
@@ -103,7 +104,7 @@ void open (soci::session& s,
if (beName == "sqlite")
s.open(soci::sqlite3, connectionString);
else
- throw std::runtime_error ("Unsupported soci backend: " + beName);
+ Throw ("Unsupported soci backend: " + beName);
}
static
@@ -115,7 +116,7 @@ sqlite_api::sqlite3* getConnection (soci::session& s)
result = b->conn_;
if (! result)
- throw std::logic_error ("Didn't get a database connection.");
+ Throw ("Didn't get a database connection.");
return result;
}
@@ -123,7 +124,7 @@ sqlite_api::sqlite3* getConnection (soci::session& s)
size_t getKBUsedAll (soci::session& s)
{
if (! getConnection (s))
- throw std::logic_error ("No connection found.");
+ Throw