clarify errors

* use macros for logic errors, not input errors
* throw on parsing failure in `operator>>()`, not assert
* throw on malloc, not assert
This commit is contained in:
Christopher Dunn
2015-03-08 12:05:28 -05:00
parent ee4ea0ec3f
commit 717b08695e
4 changed files with 17 additions and 9 deletions

View File

@@ -1994,7 +1994,7 @@ std::istream& operator>>(std::istream& sin, Value& root) {
"Error from reader: %s",
errs.c_str());
JSON_FAIL_MESSAGE("reader error");
throw std::runtime_error("reader error");
}
return sin;
}