From: Gunnar Beutner Date: Sat, 20 Dec 2014 08:17:02 +0000 (+0100) Subject: Improve error message for invalid field accesses X-Git-Tag: v2.3.0~433 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fddec0dd3eca218b925d4c2bc5bf207be324d62;p=icinga2 Improve error message for invalid field accesses fixes #8079 --- diff --git a/lib/base/value.hpp b/lib/base/value.hpp index 0e3a6123a..bb68acd4b 100644 --- a/lib/base/value.hpp +++ b/lib/base/value.hpp @@ -139,7 +139,7 @@ public: return intrusive_ptr(); if (!IsObject()) - BOOST_THROW_EXCEPTION(std::runtime_error("Cannot convert value to object.")); + BOOST_THROW_EXCEPTION(std::runtime_error("Cannot convert value of type '" + GetTypeName() + "' to an object.")); Object::Ptr object = boost::get(m_Value);