diff --git a/deps/ox/src/ox/oc/read.hpp b/deps/ox/src/ox/oc/read.hpp index 30638c80..763e5102 100644 --- a/deps/ox/src/ox/oc/read.hpp +++ b/deps/ox/src/ox/oc/read.hpp @@ -144,7 +144,11 @@ Error OrganicClawReader::field(const char *key, T *val) noexcept { if (jv.empty()) { *val = 0; } else if (rightType) { - *val = static_cast(jv.asUInt()); + if constexpr(ox::is_signed_v) { + *val = static_cast(jv.asInt64()); + } else { + *val = static_cast(jv.asUInt64()); + } } else { err = ox::Error(1, "Type mismatch"); } @@ -172,7 +176,8 @@ Error OrganicClawReader::field(const char *key, T *val) noexcept { err = ox::Error(1, "Type mismatch"); } } - } catch (Json::LogicError const&) { + } catch (Json::LogicError const&e) { + oxDebugf("JSON error: {}", e.what()); err = ox::Error(1, "error reading JSON data"); } ++m_fieldIt;