From 6337978038f5e67604159b19306d7117ec2a9734 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 29 Sep 2020 12:36:57 +0200 Subject: [PATCH] Improve Unknow Enum reporting message --- src/utilities/core/EnumBase.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utilities/core/EnumBase.hpp b/src/utilities/core/EnumBase.hpp index d26f8cf0cc1..8d069851f91 100644 --- a/src/utilities/core/EnumBase.hpp +++ b/src/utilities/core/EnumBase.hpp @@ -71,7 +71,7 @@ template auto itr = m.find(t_value); if (itr == m.end()) { - throw std::runtime_error("Invalid domain for OpenStudio Enum"); + throw std::runtime_error("Invalid domain for OpenStudio Enum " + Enum::enumName()); } return itr->second; } @@ -147,7 +147,7 @@ template { return itr->second; } - throw std::runtime_error("Unknown OpenStudio Enum Value '" + t_name + "'"); + throw std::runtime_error("Unknown OpenStudio Enum Value '" + t_name + "' for Enum " + Enum::enumName()); } /** Returns t_value if it is in the domain. Otherwise throws std::runtime_error. */ @@ -158,7 +158,7 @@ template { return t_value; } else { - throw std::runtime_error("Unknown OpenStudio Enum Value = " + std::to_string(t_value)); + throw std::runtime_error("Unknown OpenStudio Enum Value = " + std::to_string(t_value) + "' for Enum " + Enum::enumName()); } }