From e0b709fa63ce47440d872f7b0e97142338a31b49 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Wed, 16 Apr 2014 12:04:44 +0200 Subject: [PATCH] in case of a connection error, we no longer call the channel wide error handler --- include/channelimpl.h | 7 ++++--- include/connectionimpl.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/channelimpl.h b/include/channelimpl.h index a4c4e39..846c1b8 100644 --- a/include/channelimpl.h +++ b/include/channelimpl.h @@ -481,9 +481,10 @@ public: /** * Report an error message on a channel - * @param message + * @param message the error message + * @param notifyhandler should the channel-wide handler also be called? */ - void reportError(const char *message) + void reportError(const char *message, bool notifyhandler = true) { // change state _state = state_closed; @@ -521,7 +522,7 @@ public: _newestCallback = nullptr; // inform handler - if (_errorCallback) _errorCallback(message); + if (notifyhandler && _errorCallback) _errorCallback(message); } /** diff --git a/include/connectionimpl.h b/include/connectionimpl.h index bd654b2..836d3a0 100644 --- a/include/connectionimpl.h +++ b/include/connectionimpl.h @@ -285,7 +285,7 @@ public: for (auto &iter : _channels) { // report the errors - iter.second->reportError(message); + iter.second->reportError(message, false); // leap out if no longer valid if (!monitor.valid()) return;