]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Updates error messages for addKey() 4106/head
authorBenjamin Zengin <b.zengin@yahoo.de>
Thu, 21 Jul 2016 13:41:40 +0000 (15:41 +0200)
committerBenjamin Zengin <b.zengin@yahoo.de>
Tue, 6 Sep 2016 10:09:19 +0000 (12:09 +0200)
pdns/dbdnsseckeeper.cc

index e770e4ccc360d201e6a6e75d9ae054f4ee0c5361..12aee0c98dc001cbdcb9d30b0b987a9083bbe57e 100644 (file)
@@ -77,14 +77,14 @@ bool DNSSECKeeper::addKey(const DNSName& name, bool setSEPBit, int algorithm, in
 {
   if(!bits) {
     if(algorithm <= 10)
-      throw runtime_error("Creating an algorithm " +std::to_string(algorithm)+" ("+algorithm2name(algorithm)+") key requires the size (in bits) to be passed");
+      throw runtime_error("Creating an algorithm " +std::to_string(algorithm)+" ("+algorithm2name(algorithm)+") key requires the size (in bits) to be passed.");
     else {
       if(algorithm == 12 || algorithm == 13 || algorithm == 250) // GOST, ECDSAP256SHA256, ED25519SHA512
         bits = 256;
       else if(algorithm == 14) // ECDSAP384SHA384
         bits = 384;
       else {
-        throw runtime_error("Can't guess key size for algorithm "+std::to_string(algorithm));
+        throw runtime_error("Can not guess key size for algorithm "+std::to_string(algorithm));
       }
     }
   }
@@ -93,7 +93,7 @@ bool DNSSECKeeper::addKey(const DNSName& name, bool setSEPBit, int algorithm, in
   try{
     dpk->create(bits);
   } catch (std::runtime_error error){
-    throw runtime_error("Wrong bit size!");
+    throw runtime_error("The algorithm does not support the given bit size.");
   }
   dspk.setKey(dpk);
   dspk.d_algorithm = algorithm;