mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Convert throws and catch alls (RIPD-1046)
This commit is contained in:
committed by
Nik Bougalis
parent
0633ef1ba1
commit
880f354b90
@@ -18,6 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/protocol/Indexes.h>
|
||||
@@ -36,7 +37,7 @@ STLedgerEntry::STLedgerEntry (Keylet const& k)
|
||||
mFormat =
|
||||
LedgerFormats::getInstance().findByType (type_);
|
||||
if (mFormat == nullptr)
|
||||
throw std::runtime_error ("invalid ledger entry type");
|
||||
Throw<std::runtime_error> ("invalid ledger entry type");
|
||||
set (mFormat->elements);
|
||||
setFieldU16 (sfLedgerEntryType,
|
||||
static_cast <std::uint16_t> (mFormat->getType ()));
|
||||
@@ -72,7 +73,7 @@ void STLedgerEntry::setSLEType ()
|
||||
static_cast <LedgerEntryType> (getFieldU16 (sfLedgerEntryType)));
|
||||
|
||||
if (mFormat == nullptr)
|
||||
throw std::runtime_error ("invalid ledger entry type");
|
||||
Throw<std::runtime_error> ("invalid ledger entry type");
|
||||
|
||||
type_ = mFormat->getType ();
|
||||
if (!setType (mFormat->elements))
|
||||
@@ -80,7 +81,7 @@ void STLedgerEntry::setSLEType ()
|
||||
WriteLog (lsWARNING, SerializedLedger)
|
||||
<< "Ledger entry not valid for type " << mFormat->getName ();
|
||||
WriteLog (lsWARNING, SerializedLedger) << getJson (0);
|
||||
throw std::runtime_error ("ledger entry not valid for type");
|
||||
Throw<std::runtime_error> ("ledger entry not valid for type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user