From e971f64f92c640d3ee634b01eeba7fbf056fdaac Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 28 Mar 2014 01:47:48 +0100 Subject: Catch all exception produced by a received message (irc or xmpp) --- src/xmpp/xmpp_parser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/xmpp') diff --git a/src/xmpp/xmpp_parser.cpp b/src/xmpp/xmpp_parser.cpp index 867648b..536d9da 100644 --- a/src/xmpp/xmpp_parser.cpp +++ b/src/xmpp/xmpp_parser.cpp @@ -131,7 +131,13 @@ void XmppParser::char_data(const XML_Char* data, int len) void XmppParser::stanza_event(const Stanza& stanza) const { for (const auto& callback: this->stanza_callbacks) - callback(stanza); + { + try { + callback(stanza); + } catch (const std::exception& e) { + log_debug("Unhandled exception: " << e.what()); + } + } } void XmppParser::stream_open_event(const XmlNode& node) const -- cgit v1.2.3