From 010e3ef2105fd092ffe6a00f4964d457477e6e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E9=A3=8F?= Date: Tue, 3 Dec 2024 14:44:09 +0800 Subject: [PATCH] polish --- .../metric_models/SelfMonitorMetricEvent.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/monitor/metric_models/SelfMonitorMetricEvent.cpp b/core/monitor/metric_models/SelfMonitorMetricEvent.cpp index 367163a400..e35698e359 100644 --- a/core/monitor/metric_models/SelfMonitorMetricEvent.cpp +++ b/core/monitor/metric_models/SelfMonitorMetricEvent.cpp @@ -67,8 +67,19 @@ SelfMonitorMetricEvent::SelfMonitorMetricEvent(const std::mapisString()) { try { mCounters[itr.key().asString()] = static_cast(std::stod(itr->asString())); - } catch (...) { + } catch (...) { // catch std::invalid_argument & std::out_of_range mCounters[itr.key().asString()] = 0; } }