File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 * for pre-condition violations and internal logic errors.
1919 */
2020#if JSON_USE_EXCEPTION
21- #include < stdexcept>
22- #define JSON_ASSERT (condition ) \
23- {if (!(condition)) {throw std::logic_error ( " assert json failed" );}} // @todo <= add detail about condition in exception
24- #define JSON_FAIL_MESSAGE (message ) \
21+
22+ // @todo <= add detail about condition in exception
23+ # define JSON_ASSERT (condition ) \
24+ {if (!(condition)) {Json::throwLogicError ( " assert json failed" );}}
25+
26+ # define JSON_FAIL_MESSAGE (message ) \
2527 { \
2628 std::ostringstream oss; oss << message; \
27- throw std::logic_error (oss.str ()); \
29+ Json::throwLogicError (oss.str ()); \
30+ abort (); \
2831 }
29- // #define JSON_FAIL_MESSAGE(message) throw std::logic_error(message)
32+
3033#else // JSON_USE_EXCEPTION
31- #define JSON_ASSERT (condition ) assert (condition)
34+
35+ # define JSON_ASSERT (condition ) assert (condition)
3236
3337// The call to assert() will show the failure message in debug builds. In
3438// release builds we abort, for a core-dump or debugger.
35- #define JSON_FAIL_MESSAGE (message ) \
39+ # define JSON_FAIL_MESSAGE (message ) \
3640 { \
3741 std::ostringstream oss; oss << message; \
3842 assert (false && oss.str ().c_str ()); \
You can’t perform that action at this time.
0 commit comments