From ffc8c43962706454ebfa724fc9bccf3a47e9f7d1 Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Tue, 8 Mar 2016 19:34:56 -0800 Subject: Lib: add amqp_rpc_reply_error convenience function Add internal function to construct amqp_rpc_reply_t that are library errors. --- librabbitmq/amqp_private.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index ab2b5f3..245612b 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -369,6 +369,13 @@ amqp_abort(const char *fmt, ...); int amqp_bytes_equal(amqp_bytes_t r, amqp_bytes_t l); +static inline amqp_rpc_reply_t amqp_rpc_reply_error(amqp_status_enum status) { + amqp_rpc_reply_t reply; + reply.reply_type = AMQP_RESPONSE_LIBRARY_EXCEPTION; + reply.library_error = status; + return reply; +} + int amqp_send_frame_inner(amqp_connection_state_t state, const amqp_frame_t *frame, int flags); #endif -- cgit v1.2.1