update readme.md with onLost/onError handling example because it didnt compile (order was wrong) (fixes #422)

This commit is contained in:
Emiel Bruijntjes 2022-01-26 16:57:01 +01:00
parent faa58852cb
commit 5625fdb59c
1 changed files with 5 additions and 5 deletions

View File

@ -1133,17 +1133,17 @@ reliable.publish("my-exchange", "my-key", "my first message").onAck([]() {
// the message has _explicitly_ been nack'ed by RabbitMQ (in your application
// code you probably want to log or handle this to avoid data-loss)
}).onError([](const char *message) {
// a channel-error occurred before any ack or nack was received, and the
// message is probably lost too (which you want to handle)
}).onLost([]() {
// because the implementation for onNack() and onError() will be the same
// in many applications, you can also choose to install a onLost() handler,
// which is called when the message has either been nack'ed, or lost.
}).onError([](const char *message) {
// a channel-error occurred before any ack or nack was received, and the
// message is probably lost (which you might want to handle)
});
````