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