Skip to content

Commit 1522e4d

Browse files
committed
Merge pull request open-source-parsers#174 from kobigurk/kobigurk-patch-asserts
only throws exceptions JSON_USE_EXCEPTION
2 parents f164288 + 09b8670 commit 1522e4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/json/assertions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#if JSON_USE_EXCEPTION
1717
#include <stdexcept>
1818
#define JSON_ASSERT(condition) \
19-
assert(condition); // @todo <= change this into an exception throw
19+
if (!(condition)) {throw std::runtime_error( "assert json failed" );} // @todo <= add detail about condition in exception
2020
#define JSON_FAIL_MESSAGE(message) do{std::ostringstream oss; oss << message; throw std::runtime_error(oss.str());}while(0)
2121
//#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message)
2222
#else // JSON_USE_EXCEPTION

0 commit comments

Comments
 (0)