{
if(end-begin != 1)
return "Need to supply new minimum TTL number\n";
- SyncRes::s_minimumTTL = pdns_stou(*begin);
- return "New minimum TTL: " + std::to_string(SyncRes::s_minimumTTL) + "\n";
+ try {
+ SyncRes::s_minimumTTL = pdns_stou(*begin);
+ return "New minimum TTL: " + std::to_string(SyncRes::s_minimumTTL) + "\n";
+ }
+ catch (const std::exception& e) {
+ return "Error parsing the new minimum TTL number: " + std::string(e.what()) + "\n";
+ }
}
template<typename T>
{
if(end-begin != 1)
return "Need to supply new ECS minimum TTL number\n";
- SyncRes::s_minimumECSTTL = pdns_stou(*begin);
- return "New minimum ECS TTL: " + std::to_string(SyncRes::s_minimumECSTTL) + "\n";
+ try {
+ SyncRes::s_minimumECSTTL = pdns_stou(*begin);
+ return "New minimum ECS TTL: " + std::to_string(SyncRes::s_minimumECSTTL) + "\n";
+ }
+ catch (const std::exception& e) {
+ return "Error parsing the new ECS minimum TTL number: " + std::string(e.what()) + "\n";
+ }
}
template<typename T>
{
if(end-begin != 1)
return "Need to supply new cache size\n";
- g_maxCacheEntries = pdns_stou(*begin);
- return "New max cache entries: " + std::to_string(g_maxCacheEntries) + "\n";
+ try {
+ g_maxCacheEntries = pdns_stou(*begin);
+ return "New max cache entries: " + std::to_string(g_maxCacheEntries) + "\n";
+ }
+ catch (const std::exception& e) {
+ return "Error parsing the new cache size: " + std::string(e.what()) + "\n";
+ }
}
template<typename T>
{
if(end-begin != 1)
return "Need to supply new packet cache size\n";
- g_maxPacketCacheEntries = pdns_stou(*begin);
- return "New max packetcache entries: " + std::to_string(g_maxPacketCacheEntries) + "\n";
+ try {
+ g_maxPacketCacheEntries = pdns_stou(*begin);
+ return "New max packetcache entries: " + std::to_string(g_maxPacketCacheEntries) + "\n";
+ }
+ catch (const std::exception& e) {
+ return "Error parsing the new packet cache size: " + std::string(e.what()) + "\n";
+ }
}