From ba532e0434c1fa87081498d005cc4a6327f0bb4c Mon Sep 17 00:00:00 2001 From: Youri Moll Date: Fri, 21 Sep 2018 12:26:23 +0200 Subject: [PATCH] onError should be overloaded by subclass, otherwise callback installers are no longer available for that class. --- include/amqpcpp/deferredget.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/amqpcpp/deferredget.h b/include/amqpcpp/deferredget.h index 78332be..dba731a 100644 --- a/include/amqpcpp/deferredget.h +++ b/include/amqpcpp/deferredget.h @@ -103,6 +103,19 @@ public: // allow chaining return *this; } + + /** + * Register a function to be called when an error occurs. This should be defined, otherwise the base methods are used. + * @param callback + */ + DeferredGet &onError(const ErrorCallback &callback) + { + // store the callback + _errorCallback = callback; + + // allow chaining + return *this; + } /** * Register a function to be called when a message arrives