Improve exception handling:

* Self-document the code by renaming Throw to Rethrow.
* Write a message to the debug log when we throw or
  rethrow an exception.
This commit is contained in:
Nik Bougalis
2016-05-18 13:00:11 -07:00
parent a039e7593a
commit 97c89168f7
10 changed files with 47 additions and 26 deletions

View File

@@ -154,7 +154,7 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log)
{
log << "Invalid value '" << result.first <<
"' for key 'ip' in [" << section.name() << "]\n";
Throw();
Rethrow();
}
}
}
@@ -177,7 +177,7 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log)
log <<
"Invalid value '" << result.first << "' for key " <<
"'port' in [" << section.name() << "]\n";
Throw();
Rethrow();
}
}
}
@@ -207,7 +207,7 @@ parse_Port (ParsedPort& port, Section const& section, std::ostream& log)
log <<
"Invalid value '" << lim << "' for key " <<
"'limit' in [" << section.name() << "]\n";
Throw();
Rethrow();
}
}
}