From e3ca832497f99cec9fb9c7dce21862b6bb70e9b8 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 17 May 2018 17:12:06 +0200 Subject: [PATCH] Property: silently return empty string when serialization is not supported --- core/include/moveit/task_constructor/properties.h | 2 +- core/test/test_properties.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/include/moveit/task_constructor/properties.h b/core/include/moveit/task_constructor/properties.h index e2496c0b..cea3e61d 100644 --- a/core/include/moveit/task_constructor/properties.h +++ b/core/include/moveit/task_constructor/properties.h @@ -91,7 +91,7 @@ class Property { template static typename std::enable_if::value, std::string>::type serialize(const boost::any& value) { - throw std::runtime_error (std::string("no operator<< for type ") + typeid(T).name()); + return ""; } public: diff --git a/core/test/test_properties.cpp b/core/test/test_properties.cpp index 9b1ed1ee..67e9f576 100644 --- a/core/test/test_properties.cpp +++ b/core/test/test_properties.cpp @@ -86,7 +86,7 @@ TEST(Property, serialize) { // std::map doesn't provide operator<< serialization props.declare>("map", std::map()); - EXPECT_THROW(props.property("map").serialize(), std::runtime_error); + EXPECT_EQ(props.property("map").serialize(), ""); } class InitFromTest : public ::testing::Test {