mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-07 09:04:57 +02:00
assertions should be logic_error
This commit is contained in:
parent
493f6dcebe
commit
0c91927da2
@ -16,9 +16,9 @@
|
|||||||
#if JSON_USE_EXCEPTION
|
#if JSON_USE_EXCEPTION
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#define JSON_ASSERT(condition) \
|
#define JSON_ASSERT(condition) \
|
||||||
if (!(condition)) {throw std::runtime_error( "assert json failed" );} // @todo <= add detail about condition in exception
|
if (!(condition)) {throw std::logic_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) do{std::ostringstream oss; oss << message; throw std::logic_error(oss.str());}while(0)
|
||||||
//#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message)
|
//#define JSON_FAIL_MESSAGE(message) throw std::logic_error(message)
|
||||||
#else // JSON_USE_EXCEPTION
|
#else // JSON_USE_EXCEPTION
|
||||||
#define JSON_ASSERT(condition) assert(condition);
|
#define JSON_ASSERT(condition) assert(condition);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user