diff options
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/irc_client.cpp | 6 | ||||
-rw-r--r-- | src/irc/irc_client.hpp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 6468094..e518ffc 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -93,9 +93,11 @@ void IrcClient::on_connected() this->send_pending_data(); } -void IrcClient::on_connection_close() +void IrcClient::on_connection_close(const std::string& error_msg) { - static const std::string message = "Connection closed by remote server."; + std::string message = "Connection closed by remote server."; + if (!error_msg.empty()) + message += ": " + error_msg; const IrcMessage error{"ERROR", {message}}; this->on_error(error); log_warning(message); diff --git a/src/irc/irc_client.hpp b/src/irc/irc_client.hpp index afa6437..88d2d72 100644 --- a/src/irc/irc_client.hpp +++ b/src/irc/irc_client.hpp @@ -41,7 +41,7 @@ public: /** * Close the connection, remove us from the poller */ - void on_connection_close() override final; + void on_connection_close(const std::string& error) override final; /** * Parse the data we have received so far and try to get one or more * complete messages from it. |