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:
parent
5c76b6c976
commit
9a2382b444
1 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue