]> granicus.if.org Git - icinga2/commitdiff
Improve error message for invalid field accesses
authorGunnar Beutner <gunnar@beutner.name>
Sat, 20 Dec 2014 08:17:02 +0000 (09:17 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Sat, 20 Dec 2014 08:17:02 +0000 (09:17 +0100)
fixes #8079

lib/base/value.hpp

index 0e3a6123a798830409f396178dcf0c8268a9fa9c..bb68acd4b4af2c9dafaa61532e0fb82c1a252cda 100644 (file)
@@ -139,7 +139,7 @@ public:
                        return intrusive_ptr<T>();
 
                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<Object::Ptr>(m_Value);