Skip to content

Commit

Permalink
Improve Unknow Enum reporting message
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Sep 29, 2020
1 parent 3f49e17 commit 6337978
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utilities/core/EnumBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ template<typename Enum>
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;
}
Expand Down Expand Up @@ -147,7 +147,7 @@ template<typename Enum>
{
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. */
Expand All @@ -158,7 +158,7 @@ template<typename Enum>
{
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());
}
}

Expand Down

0 comments on commit 6337978

Please sign in to comment.