From cbcd6c288cae6bc1fbf0ce65aea571578771d4e9 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 21 Apr 2020 03:08:54 -0700 Subject: [PATCH] modules/m_control: Don't propagate exception after unloading the module it originated from. --- modules/m_control.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/m_control.cc b/modules/m_control.cc index 17314fa86..3dff2c86c 100644 --- a/modules/m_control.cc +++ b/modules/m_control.cc @@ -89,8 +89,17 @@ noexcept try out.exceptions(out.badbit | out.failbit | out.eofbit); out << "
";
-	static const string_view opts{"html"};
-	command(out, body, opts);
+	static const string_view opts{"html"}; try
+	{
+		command(out, body, opts);
+	}
+	catch(const std::exception &e)
+	{
+		const ctx::exception_handler eh;
+		notice(control_room, e.what());
+		return;
+	}
+
 	out << "
"; std::string str