void ThrowException(void) const
{
- boost::rethrow_exception(m_Exception);
+ if (m_Exception)
+ boost::rethrow_exception(m_Exception);
}
private:
JsonContext *context = static_cast<JsonContext *>(ctx);
try {
- context->AddValue(String(reinterpret_cast<const char *>(str), reinterpret_cast<const char *>(str) + len));
+ context->AddValue(String(str, str + len));
} catch (...) {
context->SaveException();
return 0;
yajl_free(handle);
+ /* throw saved exception (if there is one) */
+ context.ThrowException();
+
BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
}