From 09b8670536378b963e3ea5f4ba93aac823ceb473 Mon Sep 17 00:00:00 2001 From: Kobi Gurkan Date: Sun, 15 Feb 2015 18:00:31 +0200 Subject: [PATCH] only throws exceptions JSON_USE_EXCEPTION JSON_ASSERT now throws a runtime_error --- include/json/assertions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/json/assertions.h b/include/json/assertions.h index 21d8907..057be96 100644 --- a/include/json/assertions.h +++ b/include/json/assertions.h @@ -16,7 +16,7 @@ #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ - assert(condition); // @todo <= change this into an exception throw + if (!(condition)) {throw std::runtime_error( "assert json failed" );} // @todo <= add detail about condition in exception #define JSON_FAIL_MESSAGE(message) do{std::ostringstream oss; oss << message; throw std::runtime_error(oss.str());}while(0) //#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message) #else // JSON_USE_EXCEPTION