Skip to content

Commit

Permalink
[OMON-655] Improve error message when dividing by 0 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn authored Mar 22, 2023
1 parent 0d4d2d2 commit b5744e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif()

# Define project
project(Monitoring
VERSION 3.15.2
VERSION 3.15.4
DESCRIPTION "O2 Monitoring library"
LANGUAGES CXX
)
Expand Down
2 changes: 1 addition & 1 deletion src/DerivedMetrics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b5744e0

Please sign in to comment.