Skip to content

Commit

Permalink
Improve (a bit) error message casting JSON number.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Feb 26, 2024
1 parent 74e48c1 commit 686dde6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/source/notation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ inline std::string Str(const Any &value) { orc_block({
// XXX: this is dangerous and needs Fit
template <typename Type_>
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);
}
}

Expand Down

0 comments on commit 686dde6

Please sign in to comment.