0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️:homeserver: Prevent exception propagation for signoff(homeserver).

This commit is contained in:
Jason Volk 2020-05-09 19:41:10 -07:00
parent 5c76b6c976
commit 9a2382b444

View file

@ -11,7 +11,7 @@
namespace ircd::m
{
static void bootstrap(homeserver &);
static void signon(homeserver &), signoff(homeserver &);
static void signon(homeserver &), signoff(homeserver &) noexcept;
extern conf::item<std::string> online_status_msg;
extern conf::item<std::string> offline_status_msg;
@ -789,10 +789,26 @@ ircd::m::signon(homeserver &homeserver)
void
ircd::m::signoff(homeserver &homeserver)
noexcept try
{
if(!std::uncaught_exceptions() && !ircd::write_avoid && vm::sequence::retired != 0)
presence::set(homeserver.self, "offline", offline_status_msg);
}
catch(const std::exception &e)
{
log::error
{
log, "homeserver signoff failure :%s",
e.what(),
};
}
catch(...)
{
log::critical
{
log, "Unknown error during homeserver signoff"
};
}
//
// bootstrap