Browse Source

[5123] Added DhcpConfigError convention

Francis Dupont 8 years ago
parent
commit
6e922a7af0
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/lib/cc/dhcp_config_error.h

+ 12 - 0
src/lib/cc/dhcp_config_error.h

@@ -14,6 +14,18 @@ namespace dhcp {
 
 /// An exception that is thrown if an error occurs while configuring
 /// DHCP server.
+/// By convention when this exception is thrown there is a position
+/// between parentheses so the code style should be like this:
+///
+/// try {
+///     ...
+/// } catch (const DhcpConfigError&) {
+///     throw;
+/// } catch (const std::exception& ex) {
+///    isc_throw(DhcpConfigError, "message" << ex.what()
+///              << " (" << getPosition(what) << ")");
+/// }
+
 class DhcpConfigError : public isc::Exception {
 public: