From 3b337fd98091bfb4853f81979c178db3b0b4f59a Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Sat, 20 Jun 2015 11:25:26 -0700 Subject: [PATCH] use separate exceptions --- rclcpp/include/rclcpp/parameter.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rclcpp/include/rclcpp/parameter.hpp b/rclcpp/include/rclcpp/parameter.hpp index e8c6523..4e5e153 100644 --- a/rclcpp/include/rclcpp/parameter.hpp +++ b/rclcpp/include/rclcpp/parameter.hpp @@ -202,9 +202,11 @@ public: case PARAMETER_BYTES: return ParameterVariant(parameter.name, parameter.value.bytes_value); case PARAMETER_NOT_SET: + throw std::runtime_error("Type from ParameterValue is not set"); default: // TODO: use custom exception - throw std::runtime_error("Invalid type from ParameterValue"); + throw std::runtime_error( + "Unexpected type from ParameterVariant: " + std::to_string(parameter.value.type)); } }