From 7fde55a4b53677540bcba623a5ce731c6eb97e25 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 13 Jun 2020 20:10:26 -0700 Subject: [PATCH] ircd::info::version: Handle all closure errors to ensure construction. --- ircd/info.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ircd/info.cc b/ircd/info.cc index 22c14303d..d66fadbb3 100644 --- a/ircd/info.cc +++ b/ircd/info.cc @@ -96,7 +96,20 @@ ircd::info::versions::versions(const string_view &name, ,semantic{semantic} ,string{'\0'} { - closure(*this, this->string); + if(closure) try + { + closure(*this, this->string); + } + catch(const std::exception &e) + { + log::error + { + "Querying %s version of '%s' :%s", + type == type::ABI? "ABI"_sv : "API"_sv, + name, + e.what(), + }; + } // User provided a string already; nothing else to do if(strnlen(this->string, sizeof(this->string)) != 0)