Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

traffic_top - Fix uncought exception #12100

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/traffic_top/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,15 @@ class Stats
const LookupItem &item = lookup_it->second;

if (item.type == 1 || item.type == 2 || item.type == 5 || item.type == 8) {
// Add records names to the rpc request.
request.emplace_rec(detail::MetricParam{item.name});
try {
// Add records names to the rpc request.
request.emplace_rec(detail::MetricParam{item.name});
} catch (std::exception const &e) {
// Hard break, something happened when trying to set the last metric name into the request.
// This is very unlikely but just in case, we stop it.
fprintf(stderr, "Error configuring the stats request, local error: %s", e.what());
return false;
}
}
}
// query the rpc node.
Expand Down