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;