From 9a2382b4441bc1cee968d946b43edbe2c418cecd Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 9 May 2020 19:41:10 -0700 Subject: [PATCH] ircd::m::homeserver: Prevent exception propagation for signoff(homeserver). --- matrix/homeserver.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/matrix/homeserver.cc b/matrix/homeserver.cc index d5e0663a4..ab8ed71f6 100644 --- a/matrix/homeserver.cc +++ b/matrix/homeserver.cc @@ -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 online_status_msg; extern conf::item 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