mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-09 13:18:09 +00:00
refactor: Build Throw messages with std::format (#8474)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <cerrno>
|
||||
#include <cstddef>
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <ios>
|
||||
@@ -99,12 +100,13 @@ uniqueRandomPath(
|
||||
if (ec)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Unable to check path '" + candidate.string() + "': " + ec.message());
|
||||
std::format("Unable to check path '{}': {}", candidate.string(), ec.message()));
|
||||
}
|
||||
if (!exists)
|
||||
return candidate;
|
||||
}
|
||||
Throw<std::runtime_error>("Unable to generate a unique path under '" + base.string() + "'");
|
||||
Throw<std::runtime_error>(
|
||||
std::format("Unable to generate a unique path under '{}'", base.string()));
|
||||
}
|
||||
|
||||
TempDir::TempDir() : path_(uniqueRandomPath(std::filesystem::temp_directory_path()))
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <boost/container/pmr/monotonic_buffer_resource.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
#include <format>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
@@ -264,7 +265,7 @@ OpenView::rawTxInsert(
|
||||
auto const result = txs_.emplace(
|
||||
std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(txn, metaData));
|
||||
if (!result.second)
|
||||
Throw<std::logic_error>("rawTxInsert: duplicate TX id: " + to_string(key));
|
||||
Throw<std::logic_error>(std::format("rawTxInsert: duplicate TX id: {}", to_string(key)));
|
||||
}
|
||||
|
||||
} // namespace xrpl
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
@@ -394,9 +395,11 @@ removeToken(ApplyView& view, AccountID const& owner, UInt256 const& nftokenID, S
|
||||
|
||||
if (!page2)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"page " + to_string(page1->key()) + " has a broken " + field.getName() +
|
||||
" field pointing to " + to_string(*id));
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"page {} has a broken {} field pointing to {}",
|
||||
to_string(page1->key()),
|
||||
field.getName(),
|
||||
to_string(*id)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -597,7 +600,7 @@ removeTokenOffersWithLimit(ApplyView& view, Keylet const& directory, std::size_t
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Offer " + to_string(offerIndexes[i]) + " cannot be deleted!");
|
||||
std::format("Offer {} cannot be deleted!", to_string(offerIndexes[i])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,9 +737,9 @@ repairNFTokenDirectoryLinks(ApplyView& view, AccountID const& owner)
|
||||
if (!newPrev)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
Throw<std::runtime_error>(
|
||||
"NFTokenPage directory for " + to_string(owner) +
|
||||
" cannot be repaired. Unexpected link problem.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"NFTokenPage directory for {} cannot be repaired. Unexpected link problem.",
|
||||
to_string(owner)));
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
newPrev->at(sfNextPageMin) = nextPage->key();
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <atomic>
|
||||
#include <cstddef>
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
@@ -193,7 +194,7 @@ public:
|
||||
if (!s.ok())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Unable to set RocksDB bbt_options: ") + s.ToString());
|
||||
std::format("Unable to set RocksDB bbt_options: {}", s.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +207,7 @@ public:
|
||||
if (!s.ok())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Unable to set RocksDB options: ") + s.ToString());
|
||||
std::format("Unable to set RocksDB options: {}", s.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +242,7 @@ public:
|
||||
if (!status.ok() || (localDb == nullptr))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Unable to open/create RocksDB: ") + status.ToString());
|
||||
std::format("Unable to open/create RocksDB: {}", status.ToString()));
|
||||
}
|
||||
db.reset(localDb);
|
||||
}
|
||||
@@ -356,7 +357,7 @@ public:
|
||||
auto ret = db->Write(options, &wb);
|
||||
|
||||
if (!ret.ok())
|
||||
Throw<std::runtime_error>("storeBatch failed: " + ret.ToString());
|
||||
Throw<std::runtime_error>(std::format("storeBatch failed: {}", ret.ToString()));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
@@ -105,8 +106,8 @@ Permission::Permission()
|
||||
if (type <= UINT16_MAX)
|
||||
{
|
||||
// LCOV_EXCL_START
|
||||
Throw<std::logic_error>(
|
||||
"Granular permission value must exceed the maximum uint16_t value: " + name);
|
||||
Throw<std::logic_error>(std::format(
|
||||
"Granular permission value must exceed the maximum uint16_t value: {}", name));
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <format>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
@@ -1193,8 +1194,7 @@ muldiv(std::uint64_t multiplier, std::uint64_t multiplicand, std::uint64_t divis
|
||||
if (ret > std::numeric_limits<std::uint64_t>::max())
|
||||
{
|
||||
Throw<std::overflow_error>(
|
||||
"overflow: (" + std::to_string(multiplier) + " * " + std::to_string(multiplicand) +
|
||||
") / " + std::to_string(divisor));
|
||||
std::format("overflow: ({} * {}) / {}", multiplier, multiplicand, divisor));
|
||||
}
|
||||
|
||||
return static_cast<uint64_t>(ret);
|
||||
@@ -1215,9 +1215,8 @@ muldivRound(
|
||||
|
||||
if (ret > std::numeric_limits<std::uint64_t>::max())
|
||||
{
|
||||
Throw<std::overflow_error>(
|
||||
"overflow: ((" + std::to_string(multiplier) + " * " + std::to_string(multiplicand) +
|
||||
") + " + std::to_string(rounding) + ") / " + std::to_string(divisor));
|
||||
Throw<std::overflow_error>(std::format(
|
||||
"overflow: (({} * {}) + {}) / {}", multiplier, multiplicand, rounding, divisor));
|
||||
}
|
||||
|
||||
return static_cast<uint64_t>(ret);
|
||||
|
||||
@@ -35,9 +35,8 @@ STLedgerEntry::STLedgerEntry(Keylet const& k) : STObject(sfLedgerEntry), key_(k.
|
||||
|
||||
if (format == nullptr)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Attempt to create a SLE of unknown type " +
|
||||
std::to_string(safeCast<std::uint16_t>(k.type)));
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Attempt to create a SLE of unknown type {}", safeCast<std::uint16_t>(k.type)));
|
||||
}
|
||||
|
||||
set(format->getSOTemplate());
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
#include <stdexcept>
|
||||
@@ -170,7 +171,7 @@ partsFromString(std::string const& number)
|
||||
boost::smatch match;
|
||||
|
||||
if (!boost::regex_match(number, match, kReNumber))
|
||||
Throw<std::runtime_error>("'" + number + "' is not a number");
|
||||
Throw<std::runtime_error>(std::format("'{}' is not a number", number));
|
||||
|
||||
// Match fields:
|
||||
// 0 = whole input
|
||||
|
||||
@@ -59,9 +59,8 @@ getTxFormat(TxType type)
|
||||
|
||||
if (format == nullptr)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid transaction type " +
|
||||
std::to_string(safeCast<std::underlying_type_t<TxType>>(type)));
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid transaction type {}", safeCast<std::underlying_type_t<TxType>>(type)));
|
||||
}
|
||||
|
||||
return format;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include <xrpl/protocol/Serializer.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <format>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace xrpl {
|
||||
@@ -22,7 +22,7 @@ STVector256::STVector256(SerialIter& sit, SField const& name) : STBase(name)
|
||||
if (slice.size() % UInt256::size() != 0)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Bad serialization for STVector256: " + std::to_string(slice.size()));
|
||||
std::format("Bad serialization for STVector256: {}", slice.size()));
|
||||
}
|
||||
|
||||
auto const cnt = slice.size() / UInt256::size();
|
||||
|
||||
@@ -70,7 +70,8 @@ STXChainBridge::STXChainBridge(SField const& name, json::Value const& v) : STBas
|
||||
std::string const name = it.memberName();
|
||||
if (!kBridgeJson.isMember(name))
|
||||
{
|
||||
Throw<std::runtime_error>("STXChainBridge extra field detected: " + name);
|
||||
Throw<std::runtime_error>(
|
||||
std::format("STXChainBridge extra field detected: {}", name));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
namespace xrpl {
|
||||
@@ -456,7 +456,7 @@ SerialIter::getFieldID(int& type, int& name)
|
||||
// uncommon type
|
||||
type = get8();
|
||||
if (type < 16)
|
||||
Throw<std::runtime_error>("gFID: uncommon type out of range " + std::to_string(type));
|
||||
Throw<std::runtime_error>(std::format("gFID: uncommon type out of range {}", type));
|
||||
}
|
||||
|
||||
if (name == 0)
|
||||
@@ -464,7 +464,7 @@ SerialIter::getFieldID(int& type, int& name)
|
||||
// uncommon name
|
||||
name = get8();
|
||||
if (name < 16)
|
||||
Throw<std::runtime_error>("gFID: uncommon name out of range " + std::to_string(name));
|
||||
Throw<std::runtime_error>(std::format("gFID: uncommon name out of range {}", name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <soci/sqlite3/soci-sqlite3.h> // IWYU pragma: keep
|
||||
|
||||
#include <format>
|
||||
#include <memory>
|
||||
|
||||
namespace xrpl {
|
||||
@@ -40,8 +41,8 @@ getSociSqliteInit(std::string const& name, std::string const& dir, std::string c
|
||||
{
|
||||
if (name.empty())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Sqlite databases must specify a dir and a name. Name: " + name + " Dir: " + dir);
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Sqlite databases must specify a dir and a name. Name: {} Dir: {}", name, dir));
|
||||
}
|
||||
std::filesystem::path file(dir);
|
||||
if (std::filesystem::is_directory(file))
|
||||
@@ -56,7 +57,7 @@ getSociInit(BasicConfig const& config, std::string const& dbName)
|
||||
auto const backendName = get(section, Keys::kBackend, "sqlite");
|
||||
|
||||
if (backendName != "sqlite")
|
||||
Throw<std::runtime_error>("Unsupported soci backend: " + backendName);
|
||||
Throw<std::runtime_error>(std::format("Unsupported soci backend: {}", backendName));
|
||||
|
||||
auto const path = config.legacy(Sections::kDatabasePath);
|
||||
auto const ext = dbName == "validators" || dbName == "peerfinder" ? ".sqlite" : ".db";
|
||||
@@ -101,7 +102,7 @@ open(soci::session& s, std::string const& beName, std::string const& connectionS
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("Unsupported soci backend: " + beName);
|
||||
Throw<std::runtime_error>(std::format("Unsupported soci backend: {}", beName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
@@ -48,7 +49,7 @@ to_string(Manifest const& m)
|
||||
return "Revocation Manifest " + mk;
|
||||
|
||||
if (!m.signingKey)
|
||||
Throw<std::runtime_error>("No SigningKey in manifest " + mk);
|
||||
Throw<std::runtime_error>(std::format("No SigningKey in manifest {}", mk));
|
||||
|
||||
return "Manifest " + mk + " (" + std::to_string(m.sequence) + ": " +
|
||||
toBase58(TokenType::NodePublic, *m.signingKey) + ")";
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <format>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -107,10 +108,10 @@ SHAMapNodeID::getChildNodeID(unsigned int branch) const
|
||||
depth_ <= SHAMap::kLeafDepth, "xrpl::SHAMapNodeID::getChildNodeID : maximum leaf depth");
|
||||
|
||||
if (depth_ >= SHAMap::kLeafDepth)
|
||||
Throw<std::logic_error>("Request for child node ID of " + to_string(*this));
|
||||
Throw<std::logic_error>(std::format("Request for child node ID of {}", to_string(*this)));
|
||||
|
||||
if (!isPrefixOf(id_))
|
||||
Throw<std::logic_error>("Incorrect mask for " + to_string(*this));
|
||||
Throw<std::logic_error>(std::format("Incorrect mask for {}", to_string(*this)));
|
||||
|
||||
SHAMapNodeID node{depth_ + 1, id_};
|
||||
node.id_.begin()[depth_ / 2] |= ((depth_ & 1) != 0u) ? branch : (branch << 4);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <xrpl/shamap/SHAMapTxPlusMetaLeafNode.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
@@ -30,9 +31,8 @@ SHAMapTreeNode::makeTransaction(Slice data, SHAMapHash const& hash, bool hashVal
|
||||
{
|
||||
if (data.size() < kMinShaMapItemBytes)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Short TXN node: " + std::to_string(data.size()) + " bytes (minimum " +
|
||||
std::to_string(kMinShaMapItemBytes) + " required)");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Short TXN node: {} bytes (minimum {} required)", data.size(), kMinShaMapItemBytes));
|
||||
}
|
||||
|
||||
auto item = makeShamapitem(sha512Half(HashPrefix::TransactionId, data), data);
|
||||
@@ -52,27 +52,25 @@ SHAMapTreeNode::makeTransactionWithMeta(Slice data, SHAMapHash const& hash, bool
|
||||
|
||||
if (s.size() < tag.kBytes)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Short TXN+MD node: " + std::to_string(s.size()) + " bytes (minimum " +
|
||||
std::to_string(tag.kBytes) + " required for tag)");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Short TXN+MD node: {} bytes (minimum {} required for tag)", s.size(), tag.kBytes));
|
||||
}
|
||||
|
||||
// FIXME: improve this interface so that the above check isn't needed
|
||||
if (!s.getBitString(tag, s.size() - tag.kBytes))
|
||||
{
|
||||
Throw<std::out_of_range>(
|
||||
"Short TXN+MD node: failed to read tag at offset " +
|
||||
std::to_string(s.size() - tag.kBytes));
|
||||
Throw<std::out_of_range>(std::format(
|
||||
"Short TXN+MD node: failed to read tag at offset {}", s.size() - tag.kBytes));
|
||||
}
|
||||
|
||||
s.chop(tag.kBytes);
|
||||
|
||||
if (s.size() < kMinShaMapItemBytes)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Short TXN+MD node: " + std::to_string(s.size()) +
|
||||
" bytes after tag removal (minimum " + std::to_string(kMinShaMapItemBytes) +
|
||||
" required)");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Short TXN+MD node: {} bytes after tag removal (minimum {} required)",
|
||||
s.size(),
|
||||
kMinShaMapItemBytes));
|
||||
}
|
||||
|
||||
auto item = makeShamapitem(tag, s.slice());
|
||||
@@ -92,16 +90,15 @@ SHAMapTreeNode::makeAccountState(Slice data, SHAMapHash const& hash, bool hashVa
|
||||
|
||||
if (s.size() < tag.kBytes)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Short AS node: " + std::to_string(s.size()) + " bytes (minimum " +
|
||||
std::to_string(tag.kBytes) + " required for tag)");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Short AS node: {} bytes (minimum {} required for tag)", s.size(), tag.kBytes));
|
||||
}
|
||||
|
||||
// FIXME: improve this interface so that the above check isn't needed
|
||||
if (!s.getBitString(tag, s.size() - tag.kBytes))
|
||||
{
|
||||
Throw<std::out_of_range>(
|
||||
"Short AS node: failed to read tag at offset " + std::to_string(s.size() - tag.kBytes));
|
||||
std::format("Short AS node: failed to read tag at offset {}", s.size() - tag.kBytes));
|
||||
}
|
||||
|
||||
s.chop(tag.kBytes);
|
||||
@@ -111,9 +108,10 @@ SHAMapTreeNode::makeAccountState(Slice data, SHAMapHash const& hash, bool hashVa
|
||||
|
||||
if (s.size() < kMinShaMapItemBytes)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Short AS node: " + std::to_string(s.size()) + " bytes after tag removal (minimum " +
|
||||
std::to_string(kMinShaMapItemBytes) + " required)");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Short AS node: {} bytes after tag removal (minimum {} required)",
|
||||
s.size(),
|
||||
kMinShaMapItemBytes));
|
||||
}
|
||||
|
||||
auto item = makeShamapitem(tag, s.slice());
|
||||
@@ -152,7 +150,7 @@ SHAMapTreeNode::makeFromWire(Slice rawNode)
|
||||
if (type == kWireTypeTransactionWithMeta)
|
||||
return makeTransactionWithMeta(rawNode, hash, hashValid);
|
||||
|
||||
Throw<std::runtime_error>("wire: Unknown type (" + std::to_string(type) + ")");
|
||||
Throw<std::runtime_error>(std::format("wire: Unknown type ({})", type));
|
||||
}
|
||||
|
||||
SHAMapTreeNodePtr
|
||||
@@ -183,9 +181,8 @@ SHAMapTreeNode::makeFromPrefix(Slice rawNode, SHAMapHash const& hash)
|
||||
if (type == HashPrefix::TxNode)
|
||||
return makeTransactionWithMeta(rawNode, hash, hashValid);
|
||||
|
||||
Throw<std::runtime_error>(
|
||||
"prefix: unknown type (" +
|
||||
std::to_string(safeCast<std::underlying_type_t<HashPrefix>>(type)) + ")");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"prefix: unknown type ({})", safeCast<std::underlying_type_t<HashPrefix>>(type)));
|
||||
}
|
||||
|
||||
std::string
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <boost/program_options/variables_map.hpp>
|
||||
|
||||
#include <format>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -38,7 +39,7 @@ getNodeIdentity(Application& app, boost::program_options::variables_map const& c
|
||||
if (!seed)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid [") + Sections::kNodeSeed + "] in configuration file");
|
||||
std::format("Invalid [{}] in configuration file", Sections::kNodeSeed));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
@@ -110,7 +111,7 @@ SHAMapStoreImp::SHAMapStoreImp(
|
||||
if (section.empty())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Missing [") + Sections::kNodeDatabase + "] entry in configuration file");
|
||||
std::format("Missing [{}] entry in configuration file", Sections::kNodeDatabase));
|
||||
}
|
||||
|
||||
// RocksDB only. Use sensible defaults if no values specified.
|
||||
@@ -135,15 +136,14 @@ SHAMapStoreImp::SHAMapStoreImp(
|
||||
if (deleteInterval_ < minInterval)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"online_delete must be at least " + std::to_string(minInterval));
|
||||
std::format("online_delete must be at least {}", minInterval));
|
||||
}
|
||||
|
||||
if (config.ledgerHistory > deleteInterval_)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"online_delete must not be less than ledger_history "
|
||||
"(currently " +
|
||||
std::to_string(config.ledgerHistory) + ")");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"online_delete must not be less than ledger_history (currently {})",
|
||||
config.ledgerHistory));
|
||||
}
|
||||
|
||||
// Configuration that affects the behavior of online delete
|
||||
@@ -177,7 +177,7 @@ SHAMapStoreImp::SHAMapStoreImp(
|
||||
if (maxWaitingLedgers_ < minWaiting)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"max_waiting_ledgers must be at least " + std::to_string(minWaiting));
|
||||
std::format("max_waiting_ledgers must be at least {}", minWaiting));
|
||||
}
|
||||
|
||||
stateDb_.init(config, dbName_);
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <format>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -65,14 +66,17 @@ parseSection(Section const& section)
|
||||
boost::smatch match;
|
||||
|
||||
if (!boost::regex_match(line, match, kRe1))
|
||||
Throw<std::runtime_error>("Invalid entry '" + line + "' in [" + section.name() + "]");
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::format("Invalid entry '{}' in [{}]", line, section.name()));
|
||||
}
|
||||
|
||||
UInt256 id;
|
||||
|
||||
if (!id.parseHex(match[1]))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid amendment ID '" + match[1] + "' in [" + section.name() + "]");
|
||||
std::format("Invalid amendment ID '{}' in [{}]", match[1].str(), section.name()));
|
||||
}
|
||||
|
||||
names.emplace_back(id, match[2]);
|
||||
@@ -614,7 +618,7 @@ AmendmentTableImpl::AmendmentTableImpl(
|
||||
if (!amendHash.parseHex(*amendmentHash))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Invalid amendment ID '" + *amendmentHash + " in wallet.db");
|
||||
std::format("Invalid amendment ID '{}' in wallet.db", *amendmentHash));
|
||||
}
|
||||
if (*vote == AmendmentVote::Down)
|
||||
{
|
||||
|
||||
@@ -544,9 +544,10 @@ Config::loadFromString(std::string const& fileContents)
|
||||
peersInMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
|
||||
if (*peersInMaxOpt > 1000)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value specified in [") + Sections::kPeersInMax +
|
||||
"] section; the value must be less or equal than 1000");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value specified in [{}] section; the value must be less or equal than "
|
||||
"1000",
|
||||
Sections::kPeersInMax));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,18 +557,19 @@ Config::loadFromString(std::string const& fileContents)
|
||||
peersOutMaxOpt = beast::lexicalCastThrow<std::size_t>(strTemp);
|
||||
if (*peersOutMaxOpt < 10 || *peersOutMaxOpt > 1000)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value specified in [") + Sections::kPeersOutMax +
|
||||
"] section; the value must be in range 10-1000");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value specified in [{}] section; the value must be in range 10-1000",
|
||||
Sections::kPeersOutMax));
|
||||
}
|
||||
}
|
||||
|
||||
// if one section is configured then the other must be configured too
|
||||
if ((peersInMaxOpt && !peersOutMaxOpt) || (peersOutMaxOpt && !peersInMaxOpt))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Both sections [") + Sections::kPeersInMax + "]" + " and [" +
|
||||
Sections::kPeersOutMax + "] must be configured");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Both sections [{}] and [{}] must be configured",
|
||||
Sections::kPeersInMax,
|
||||
Sections::kPeersOutMax));
|
||||
}
|
||||
|
||||
if (peersInMaxOpt && peersOutMaxOpt)
|
||||
@@ -633,9 +635,8 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value specified in [") + Sections::kRelayValidations +
|
||||
"] section");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value specified in [{}] section", Sections::kRelayValidations));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -656,16 +657,16 @@ Config::loadFromString(std::string const& fileContents)
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value specified in [") + Sections::kRelayProposals +
|
||||
"] section");
|
||||
std::format("Invalid value specified in [{}] section", Sections::kRelayProposals));
|
||||
}
|
||||
}
|
||||
|
||||
if (exists(Sections::kValidationSeed) && exists(Sections::kValidatorToken))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Cannot have both [") + Sections::kValidationSeed + "] and [" +
|
||||
Sections::kValidatorToken + "] config sections");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Cannot have both [{}] and [{}] config sections",
|
||||
Sections::kValidationSeed,
|
||||
Sections::kValidatorToken));
|
||||
}
|
||||
|
||||
if (getSingleSection(secConfig, Sections::kNetworkQuorum, strTemp, j_))
|
||||
@@ -738,9 +739,8 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (sweepInterval < 10 || sweepInterval > 600)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kSweepInterval +
|
||||
": must be between 10 and 600 inclusive");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}: must be between 10 and 600 inclusive", Sections::kSweepInterval));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,9 +750,8 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (workers < 1 || workers > 1024)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kWorkers +
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}: must be between 1 and 1024 inclusive.", Sections::kWorkers));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,9 +761,8 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (ioWorkers < 1 || ioWorkers > 1024)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kIoWorkers +
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}: must be between 1 and 1024 inclusive.", Sections::kIoWorkers));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,9 +772,8 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (prefetchWorkers < 1 || prefetchWorkers > 1024)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kPrefetchWorkers +
|
||||
": must be between 1 and 1024 inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}: must be between 1 and 1024 inclusive.", Sections::kPrefetchWorkers));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,12 +797,10 @@ Config::loadFromString(std::string const& fileContents)
|
||||
// sec.value_or("vp_base_squelch_enable", true); //
|
||||
if (sec.exists(Keys::kVpBaseSquelchEnable) && sec.exists(Keys::kVpEnable))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kReduceRelay +
|
||||
" cannot specify both vp_base_squelch_enable and vp_enable "
|
||||
"options. "
|
||||
"vp_enable was deprecated and replaced by "
|
||||
"vp_base_squelch_enable");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {} cannot specify both vp_base_squelch_enable and vp_enable options. "
|
||||
"vp_enable was deprecated and replaced by vp_base_squelch_enable",
|
||||
Sections::kReduceRelay));
|
||||
}
|
||||
|
||||
if (sec.exists(Keys::kVpBaseSquelchEnable))
|
||||
@@ -833,10 +828,9 @@ Config::loadFromString(std::string const& fileContents)
|
||||
vpReduceRelaySquelchMaxSelectedPeers = sec.valueOr(Keys::kVpBaseSquelchMaxSelectedPeers, 5);
|
||||
if (vpReduceRelaySquelchMaxSelectedPeers < 3)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kReduceRelay +
|
||||
" vp_base_squelch_max_selected_peers must be "
|
||||
"greater than or equal to 3");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {} vp_base_squelch_max_selected_peers must be greater than or equal to 3",
|
||||
Sections::kReduceRelay));
|
||||
}
|
||||
/**
|
||||
* ////////////// !!END OF TEMPORARY CODE BLOCK!! /////////////////////
|
||||
@@ -848,11 +842,10 @@ Config::loadFromString(std::string const& fileContents)
|
||||
txRelayPercentage = sec.valueOr(Keys::kTxRelayPercentage, 25);
|
||||
if (txRelayPercentage < 10 || txRelayPercentage > 100 || txReduceRelayMinPeers < 10)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kReduceRelay +
|
||||
", tx_min_peers must be greater than or equal to 10"
|
||||
", tx_relay_percentage must be greater than or equal to 10 "
|
||||
"and less than or equal to 100");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}, tx_min_peers must be greater than or equal to 10, tx_relay_percentage "
|
||||
"must be greater than or equal to 10 and less than or equal to 100",
|
||||
Sections::kReduceRelay));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -866,9 +859,9 @@ Config::loadFromString(std::string const& fileContents)
|
||||
{
|
||||
if (!isProperlyFormedTomlDomain(strTemp))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kServerDomain +
|
||||
": the domain name does not appear to meet the requirements.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}: the domain name does not appear to meet the requirements.",
|
||||
Sections::kServerDomain));
|
||||
}
|
||||
|
||||
serverDomain = strTemp;
|
||||
@@ -887,16 +880,18 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value 'max_unknown_time' in ") + Sections::kOverlay +
|
||||
": must be of the form '<number>' representing seconds.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value 'max_unknown_time' in {}: must be of the form '<number>' "
|
||||
"representing seconds.",
|
||||
Sections::kOverlay));
|
||||
}
|
||||
|
||||
if (maxUnknownTime < seconds{300} || maxUnknownTime > seconds{1800})
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value 'max_unknown_time' in ") + Sections::kOverlay +
|
||||
": the time must be between 300 and 1800 seconds, inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value 'max_unknown_time' in {}: the time must be between 300 and 1800 "
|
||||
"seconds, inclusive.",
|
||||
Sections::kOverlay));
|
||||
}
|
||||
|
||||
try
|
||||
@@ -906,16 +901,18 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value 'max_diverged_time' in ") + Sections::kOverlay +
|
||||
": must be of the form '<number>' representing seconds.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value 'max_diverged_time' in {}: must be of the form '<number>' "
|
||||
"representing seconds.",
|
||||
Sections::kOverlay));
|
||||
}
|
||||
|
||||
if (maxDivergedTime < seconds{60} || maxDivergedTime > seconds{900})
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value 'max_diverged_time' in ") + Sections::kOverlay +
|
||||
": the time must be between 60 and 900 seconds, inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value 'max_diverged_time' in {}: the time must be between 60 and 900 "
|
||||
"seconds, inclusive.",
|
||||
Sections::kOverlay));
|
||||
}
|
||||
|
||||
// Both manifest counts parse and validate identically, so read them
|
||||
@@ -931,17 +928,21 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value '") + key + "' in " + Sections::kOverlay +
|
||||
": must be of the form '<number>' representing a count of manifests.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value '{}' in {}: must be of the form '<number>' representing a count "
|
||||
"of manifests.",
|
||||
key,
|
||||
Sections::kOverlay));
|
||||
}
|
||||
|
||||
if (count && (*count < kMinManifestCount || *count > kMaxManifestCount))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid value '") + key + "' in " + Sections::kOverlay +
|
||||
": the count must be between " + std::to_string(kMinManifestCount) + " and " +
|
||||
std::to_string(kMaxManifestCount) + ", inclusive.");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid value '{}' in {}: the count must be between {} and {}, inclusive.",
|
||||
key,
|
||||
Sections::kOverlay,
|
||||
kMinManifestCount,
|
||||
kMaxManifestCount));
|
||||
}
|
||||
|
||||
return count;
|
||||
@@ -958,9 +959,9 @@ Config::loadFromString(std::string const& fileContents)
|
||||
boost::smatch match;
|
||||
if (!boost::regex_match(strTemp, match, re))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kAmendmentMajorityTime +
|
||||
", must be: [0-9]+ [minutes|hours|days|weeks]");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}, must be: [0-9]+ [minutes|hours|days|weeks]",
|
||||
Sections::kAmendmentMajorityTime));
|
||||
}
|
||||
|
||||
auto const duration = beast::lexicalCastThrow<std::uint32_t>(match[1].str());
|
||||
@@ -984,10 +985,10 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (amendmentMajorityTime < minutes(15))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid ") + Sections::kAmendmentMajorityTime +
|
||||
", the minimum amount of time an amendment must hold a "
|
||||
"majority is 15 minutes");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid {}, the minimum amount of time an amendment must hold a majority is 15 "
|
||||
"minutes",
|
||||
Sections::kAmendmentMajorityTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1014,7 +1015,7 @@ Config::loadFromString(std::string const& fileContents)
|
||||
if (validatorsFile.empty())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid path specified in [") + Sections::kValidatorsFile + "]");
|
||||
std::format("Invalid path specified in [{}]", Sections::kValidatorsFile));
|
||||
}
|
||||
|
||||
if (!validatorsFile.is_absolute() && !configDir.empty())
|
||||
@@ -1022,19 +1023,19 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if (!std::filesystem::exists(validatorsFile))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("The file specified in [") + Sections::kValidatorsFile +
|
||||
"] "
|
||||
"does not exist: " +
|
||||
validatorsFile.string());
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"The file specified in [{}] does not exist: {}",
|
||||
Sections::kValidatorsFile,
|
||||
validatorsFile.string()));
|
||||
}
|
||||
else if (
|
||||
!std::filesystem::is_regular_file(validatorsFile) &&
|
||||
!std::filesystem::is_symlink(validatorsFile))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("Invalid file specified in [") + Sections::kValidatorsFile +
|
||||
"]: " + validatorsFile.string());
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Invalid file specified in [{}]: {}",
|
||||
Sections::kValidatorsFile,
|
||||
validatorsFile.string()));
|
||||
}
|
||||
}
|
||||
else if (!configDir.empty())
|
||||
@@ -1060,9 +1061,11 @@ Config::loadFromString(std::string const& fileContents)
|
||||
auto const data = getFileContents(ec, validatorsFile);
|
||||
if (ec)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Failed to read '" + validatorsFile.string() + "'." +
|
||||
std::to_string(ec.value()) + ": " + ec.message());
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Failed to read '{}': {} (error {})",
|
||||
validatorsFile.string(),
|
||||
ec.message(),
|
||||
ec.value()));
|
||||
}
|
||||
|
||||
auto iniFile = parseIniFile(data, true);
|
||||
@@ -1094,20 +1097,13 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
if ((entries == nullptr) && (valKeyEntries == nullptr) && (valListKeys == nullptr))
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string("The file specified in [") + Sections::kValidatorsFile +
|
||||
"] "
|
||||
"does not contain a [" +
|
||||
Sections::kValidators +
|
||||
"], "
|
||||
"[" +
|
||||
Sections::kValidatorKeys +
|
||||
"] or "
|
||||
"[" +
|
||||
Sections::kValidatorListKeys +
|
||||
"]"
|
||||
" section: " +
|
||||
validatorsFile.string());
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"The file specified in [{}] does not contain a [{}], [{}] or [{}] section: {}",
|
||||
Sections::kValidatorsFile,
|
||||
Sections::kValidators,
|
||||
Sections::kValidatorKeys,
|
||||
Sections::kValidatorListKeys,
|
||||
validatorsFile.string()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1127,21 +1123,16 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
if (listThreshold > section(Sections::kValidatorListKeys).values().size())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
std::string(
|
||||
"Value in config section "
|
||||
"[") +
|
||||
Sections::kValidatorListThreshold +
|
||||
"] exceeds the number of configured list keys");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Value in config section [{}] exceeds the number of configured list keys",
|
||||
Sections::kValidatorListThreshold));
|
||||
}
|
||||
return listThreshold;
|
||||
}
|
||||
|
||||
Throw<std::runtime_error>(
|
||||
std::string(
|
||||
"Config section "
|
||||
"[") +
|
||||
Sections::kValidatorListThreshold + "] should contain single value only");
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Config section [{}] should contain single value only",
|
||||
Sections::kValidatorListThreshold));
|
||||
}();
|
||||
|
||||
// Consolidate [validator_keys] and [validators]
|
||||
@@ -1151,7 +1142,7 @@ Config::loadFromString(std::string const& fileContents)
|
||||
section(Sections::kValidatorListKeys).lines().empty())
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"[" + std::string(Sections::kValidatorListKeys) + "] config section is missing");
|
||||
std::format("[{}] config section is missing", Sections::kValidatorListKeys));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,7 +1156,7 @@ Config::loadFromString(std::string const& fileContents)
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("Unknown feature: " + s + " in config file.");
|
||||
Throw<std::runtime_error>(std::format("Unknown feature: {} in config file.", s));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1290,7 +1281,8 @@ setupDatabaseCon(Config const& c, std::optional<beast::Journal> j)
|
||||
}
|
||||
else if (!boost::iequals(safetyLevel, "high"))
|
||||
{
|
||||
Throw<std::runtime_error>("Invalid safety_level value: " + safetyLevel);
|
||||
Throw<std::runtime_error>(
|
||||
std::format("Invalid safety_level value: {}", safetyLevel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1314,7 +1306,8 @@ setupDatabaseCon(Config const& c, std::optional<beast::Journal> j)
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("Invalid journal_mode value: " + journalMode);
|
||||
Throw<std::runtime_error>(
|
||||
std::format("Invalid journal_mode value: {}", journalMode));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1335,7 +1328,8 @@ setupDatabaseCon(Config const& c, std::optional<beast::Journal> j)
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("Invalid synchronous value: " + synchronous);
|
||||
Throw<std::runtime_error>(
|
||||
std::format("Invalid synchronous value: {}", synchronous));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1356,7 +1350,7 @@ setupDatabaseCon(Config const& c, std::optional<beast::Journal> j)
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>("Invalid temp_store value: " + tempStore);
|
||||
Throw<std::runtime_error>(std::format("Invalid temp_store value: {}", tempStore));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <format>
|
||||
#include <functional>
|
||||
#include <iomanip>
|
||||
#include <memory>
|
||||
@@ -1661,8 +1662,8 @@ setupOverlay(BasicConfig const& config, beast::Journal j)
|
||||
}
|
||||
catch (boost::bad_lexical_cast const&)
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
"Configured [crawl] section has invalid value: " + values.front());
|
||||
Throw<std::runtime_error>(std::format(
|
||||
"Configured [crawl] section has invalid value: {}", values.front()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user