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:
parent
4c4a94e457
commit
7fde55a4b5
1 changed files with 14 additions and 1 deletions
13
ircd/info.cc
13
ircd/info.cc
|
@ -95,8 +95,21 @@ ircd::info::versions::versions(const string_view &name,
|
||||||
,monotonic{monotonic}
|
,monotonic{monotonic}
|
||||||
,semantic{semantic}
|
,semantic{semantic}
|
||||||
,string{'\0'}
|
,string{'\0'}
|
||||||
|
{
|
||||||
|
if(closure) try
|
||||||
{
|
{
|
||||||
closure(*this, this->string);
|
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
|
// User provided a string already; nothing else to do
|
||||||
if(strnlen(this->string, sizeof(this->string)) != 0)
|
if(strnlen(this->string, sizeof(this->string)) != 0)
|
||||||
|
|
Loading…
Reference in a new issue