mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
parent
f05ccd07f9
commit
8b339a6cd5
@ -177,6 +177,7 @@ public:
|
|||||||
|
|
||||||
void ThrowException(void) const
|
void ThrowException(void) const
|
||||||
{
|
{
|
||||||
|
if (m_Exception)
|
||||||
boost::rethrow_exception(m_Exception);
|
boost::rethrow_exception(m_Exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +235,7 @@ static int DecodeString(void *ctx, const unsigned char *str, size_t len)
|
|||||||
JsonContext *context = static_cast<JsonContext *>(ctx);
|
JsonContext *context = static_cast<JsonContext *>(ctx);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
context->AddValue(String(reinterpret_cast<const char *>(str), reinterpret_cast<const char *>(str) + len));
|
context->AddValue(String(str, str + len));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
context->SaveException();
|
context->SaveException();
|
||||||
return 0;
|
return 0;
|
||||||
@ -329,6 +330,9 @@ Value icinga::JsonDecode(const String& data)
|
|||||||
|
|
||||||
yajl_free(handle);
|
yajl_free(handle);
|
||||||
|
|
||||||
|
/* throw saved exception (if there is one) */
|
||||||
|
context.ThrowException();
|
||||||
|
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
|
BOOST_THROW_EXCEPTION(std::invalid_argument(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user