]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
improve error messages a bit
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 26 Nov 2024 09:25:11 +0000 (10:25 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 26 Nov 2024 09:25:11 +0000 (10:25 +0100)
pdns/dnsdistdist/dnsdist-metrics.cc

index 89f13bef65dba4563a3ac5954ba9c51379d75806..434088df4e2f161c5af65bca534b1a7563df4619 100644 (file)
@@ -206,7 +206,7 @@ std::variant<uint64_t, Error> incrementCustomCounter(const std::string_view& nam
     metric->second.d_value += step;
     return metric->second.d_value.load();
   }
-  return std::string("Unable to increment custom metric '") + std::string(name) + "': no such metric";
+  return std::string("Unable to increment custom metric '") + std::string(name) + "': no such counter";
 }
 
 std::variant<uint64_t, Error> decrementCustomCounter(const std::string_view& name, uint64_t step)
@@ -217,7 +217,7 @@ std::variant<uint64_t, Error> decrementCustomCounter(const std::string_view& nam
     metric->second.d_value -= step;
     return metric->second.d_value.load();
   }
-  return std::string("Unable to decrement custom metric '") + std::string(name) + "': no such metric";
+  return std::string("Unable to decrement custom metric '") + std::string(name) + "': no such counter";
 }
 
 std::variant<double, Error> setCustomGauge(const std::string_view& name, const double value)
@@ -229,7 +229,7 @@ std::variant<double, Error> setCustomGauge(const std::string_view& name, const d
     return value;
   }
 
-  return std::string("Unable to set metric '") + std::string(name) + "': no such metric";
+  return std::string("Unable to set metric '") + std::string(name) + "': no such gauge";
 }
 
 std::variant<double, Error> getCustomMetric(const std::string_view& name)