From: Otto Date: Fri, 5 Feb 2021 15:00:33 +0000 (+0100) Subject: Catch exception on stats entries init and exit on that X-Git-Tag: dnsdist-1.6.0-alpha2~47^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10022%2Fhead;p=thirdparty%2Fpdns.git Catch exception on stats entries init and exit on that --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 8bdfbfaab2..0bcc47238e 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1248,7 +1248,14 @@ static void registerAllStats1() void registerAllStats() { static std::once_flag s_once; - std::call_once(s_once, registerAllStats1); + std::call_once(s_once, []() { try { + registerAllStats1(); + } + catch (...) { + g_log << Logger::Critical << "Could not add stat entries" << endl; + exit(1); + } + }); } void doExitGeneric(bool nicely)