mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 18:51:04 +08:00
assertions should be logic_error
This commit is contained in:
parent
493f6dcebe
commit
0c91927da2
@ -16,9 +16,9 @@
|
||||
#if JSON_USE_EXCEPTION
|
||||
#include <stdexcept>
|
||||
#define JSON_ASSERT(condition) \
|
||||
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)
|
||||
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::logic_error(oss.str());}while(0)
|
||||
//#define JSON_FAIL_MESSAGE(message) throw std::logic_error(message)
|
||||
#else // JSON_USE_EXCEPTION
|
||||
#define JSON_ASSERT(condition) assert(condition);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user