0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-30 02:32:43 +01:00

ircd::info::version: Handle all closure errors to ensure construction.

This commit is contained in:
Jason Volk 2020-06-13 20:10:26 -07:00
parent 4c4a94e457
commit 7fde55a4b5

View file

@ -95,8 +95,21 @@ ircd::info::versions::versions(const string_view &name,
,monotonic{monotonic}
,semantic{semantic}
,string{'\0'}
{
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)