From 07e10bb59b8d4690fe1e9be5ad7a9d3a8898b7a3 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 26 Feb 2024 10:02:16 +0000 Subject: [PATCH] Improve (a bit) error message casting JSON number. --- p2p/source/notation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/source/notation.hpp b/p2p/source/notation.hpp index 887a7f08c..2ead047d8 100644 --- a/p2p/source/notation.hpp +++ b/p2p/source/notation.hpp @@ -210,14 +210,14 @@ inline std::string Str(const Any &value) { orc_block({ // XXX: this is dangerous and needs Fit template Type_ Num(const Any &value) { - switch (value.kind()) { + switch (const auto kind = value.kind()) { case boost::json::kind::int64: return Type_(value.get_int64()); case boost::json::kind::uint64: return Type_(value.get_uint64()); case boost::json::kind::double_: return Type_(value.get_double()); - default: orc_assert(false); + default: orc_assert_(false, value << " is a " << kind); } }