]> 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)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 16 Dec 2024 15:23:30 +0000 (16:23 +0100)
(cherry picked from commit 8b9d0180585096d2c0ecf959aff1569edc90502b)

pdns/dnsdistdist/dnsdist-metrics.cc

index d47236ea8b60aca39a96f6379ab0f8c516735985..a3cbef1af9c889c46e2ddbed007e33c8c0e1f78f 100644 (file)
@@ -203,7 +203,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)
@@ -214,7 +214,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)
@@ -226,7 +226,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)