0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 20:28:52 +02:00

modules/s_conf: Handle errors on conf item create here.

This commit is contained in:
Jason Volk 2018-09-25 00:27:36 -07:00
parent 15b907167d
commit 014aa5b80e

View file

@ -203,9 +203,10 @@ init_conf_items_hook
}
};
static void
static m::event::id::buf
create_conf_item(const string_view &key,
const conf::item<> &item)
try
{
thread_local char vbuf[4_KiB];
const string_view &val
@ -213,10 +214,18 @@ create_conf_item(const string_view &key,
item.get(vbuf)
};
send(conf_room, m::me.user_id, "ircd.conf.item", key,
return set_conf_item(m::me.user_id, key, val);
}
catch(const std::exception &e)
{
if(item_error_log) log::error
{
{ "value", val }
});
"Failed to create conf item '%s' :%s",
key,
e.what()
};
return {};
}
static void