summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
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/irc/irc_client.cpp
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/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 3737b91..884f214 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -93,7 +93,13 @@ void IrcClient::parse_in_buffer(const size_t)
this->in_buf = this->in_buf.substr(pos + 2, std::string::npos);
auto cb = irc_callbacks.find(message.command);
if (cb != irc_callbacks.end())
- (this->*(cb->second))(message);
+ {
+ try {
+ (this->*(cb->second))(message);
+ } catch (const std::exception& e) {
+ log_error("Unhandled exception: " << e.what());
+ }
+ }
else
log_info("No handler for command " << message.command);
}