From b5744e074d5ca79b5768678b59cc3374582874f4 Mon Sep 17 00:00:00 2001 From: Adam Wegrzynek Date: Wed, 22 Mar 2023 14:18:00 +0100 Subject: [PATCH] [OMON-655] Improve error message when dividing by 0 (#315) --- CMakeLists.txt | 2 +- src/DerivedMetrics.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4011992f..d45491f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ endif() # Define project project(Monitoring - VERSION 3.15.2 + VERSION 3.15.4 DESCRIPTION "O2 Monitoring library" LANGUAGES CXX ) diff --git a/src/DerivedMetrics.cxx b/src/DerivedMetrics.cxx index 39925ec0..bc9405bd 100644 --- a/src/DerivedMetrics.cxx +++ b/src/DerivedMetrics.cxx @@ -80,7 +80,7 @@ bool DerivedMetrics::process(Metric& metric, DerivedMetricMode mode) int timestampCount = timestampDifference.count(); // disallow dividing by 0 if (timestampCount == 0) { - throw MonitoringException("DerivedMetrics", "Division by 0 when calculating rate for: " + metric.getFirstValue().first); + throw MonitoringException("DerivedMetrics", "Division by 0 when calculating rate for: " + metric.getName() + "/" + metric.getFirstValue().first); } auto current = metric.getFirstValue().second;