Skip to content

Commit

Permalink
Refactor error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-okeefe committed Mar 26, 2024
1 parent 4b402da commit 2be0ee9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/erin_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cmath>
#include <cstdlib>
#include <limits>
#include <sstream>
#include <stdexcept>

namespace erin_next
Expand Down Expand Up @@ -3274,12 +3275,13 @@ namespace erin_next
if (m.ComponentMap.OutflowType[fromCompId][fromTap.Port]
!= flowTypeId)
{
std::cout << "[network] "
<< "mismatch of flow types: " << fromTap.Tag
<< ":outflow="
<< fd.Type[m.ComponentMap
std::ostringstream oss;
oss << "mismatch of flow types: " << fromTap.Tag
<< ":outflow="
<< fd.Type[m.ComponentMap
.OutflowType[fromCompId][fromTap.Port]]
<< "; connection: " << flow << std::endl;
<< "; connection: " << flow;
WriteErrorMessage("network", oss.str());
return Result::Failure;
}
if (toTap.Port >= m.ComponentMap.InflowType[toCompId].size())
Expand Down
4 changes: 3 additions & 1 deletion src/erin_next_toml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ namespace erin_next
oss << "WARNING! field '" << aliasValue.Tag
<< "' is deprecated and will be removed "
<< "in a future version; use '"
<< alias.first << "' instead";
<< alias.first << "' instead (value = "
<< (value.is_string() ? value.as_string() : "")
<< ")";
warnings.push_back(
WriteErrorToString(tableName, oss.str())
);
Expand Down

0 comments on commit 2be0ee9

Please sign in to comment.