summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-03-28 01:47:48 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-03-28 01:47:48 +0100
commite971f64f92c640d3ee634b01eeba7fbf056fdaac (patch)
tree104296df08f9645578215cf826796c8c9e954792 /src/xmpp
parent44b72b743e68168e0ab55a74719d57971fe81aa3 (diff)
downloadbiboumi-e971f64f92c640d3ee634b01eeba7fbf056fdaac.tar.gz
biboumi-e971f64f92c640d3ee634b01eeba7fbf056fdaac.tar.bz2
biboumi-e971f64f92c640d3ee634b01eeba7fbf056fdaac.tar.xz
biboumi-e971f64f92c640d3ee634b01eeba7fbf056fdaac.zip
Catch all exception produced by a received message (irc or xmpp)
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/xmpp_parser.cpp8
1 files changed, 7 insertions, 1 deletions
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