The AMQPException::AMQPException( amqp_rpc_reply_t * res) constructor calls strerror in the case of AMQP_RESPONSE_LIBRARY_EXCEPTION.
strerror returns an "Unknown error" message. Instead of strerror, amqp_error_string2 should be called, as in AMQPException::AMQPException(string action, int error_code).
In short, "this->message = res->library_error ? strerror(res->library_error) : "end-of-stream";"
should be changed to "this->message = res->library_error ? amqp_error_string2(res->library_error) : "end-of-stream";"
to return a correct error message in case of AMQP_RESPONSE_LIBRARY_EXCEPTION.