From 91f1553f2c65e8c3d200fa309efe784673c27125 Mon Sep 17 00:00:00 2001 From: bcsgh <33939446+bcsgh@users.noreply.github.com> Date: Mon, 23 Mar 2020 17:34:46 -0700 Subject: [PATCH] Make throwRuntimeError/throwLogicError print msg when built with JSON_USE_EXCEPTION=0 --- src/lib_json/json_value.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 71dba6e..0872ff5 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -211,8 +212,14 @@ JSONCPP_NORETURN void throwLogicError(String const& msg) { throw LogicError(msg); } #else // !JSON_USE_EXCEPTION -JSONCPP_NORETURN void throwRuntimeError(String const& msg) { abort(); } -JSONCPP_NORETURN void throwLogicError(String const& msg) { abort(); } +JSONCPP_NORETURN void throwRuntimeError(String const& msg) { + std::cerr << msg << std::endl; + abort(); +} +JSONCPP_NORETURN void throwLogicError(String const& msg) { + std::cerr << msg << std::endl; + abort(); +} #endif // //////////////////////////////////////////////////////////////////