Parcourir la source

[2390] Include bad data in the exception message

Mukund Sivaraman il y a 12 ans
Parent
commit
11f5ae7cdd
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/lib/dns/rdata/generic/mx_15.cc

+ 3 - 2
src/lib/dns/rdata/generic/mx_15.cc

@@ -70,7 +70,8 @@ MX::MX(const std::string& mx_str) :
         const uint32_t num =
             lexer.getNextToken(MasterToken::NUMBER).getNumber();
         if (num > 65535) {
-            isc_throw(InvalidRdataText, "Invalid MX preference");
+            isc_throw(InvalidRdataText, "Invalid MX preference in: "
+                      << mx_str);
         }
         preference_ = static_cast<uint16_t>(num);
 
@@ -110,7 +111,7 @@ MX::MX(MasterLexer& lexer, const Name* origin,
 {
     const uint32_t num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
     if (num > 65535) {
-        isc_throw(InvalidRdataText, "Invalid MX preference");
+        isc_throw(InvalidRdataText, "Invalid MX preference: " << num);
     }
     preference_ = static_cast<uint16_t>(num);