Exception: BBK::AMQP::Publisher::ReturnError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bbk/amqp/publisher.rb

Overview

Исключение используемое для reject промиса - так удобнее в рамках работы с ними (проще вернуть исключение, иначе если вернуть hash то будет считать что это множество исключений)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exchange:, basic_return:, properties:, body:, **kwargs) ⇒ ReturnError

Returns a new instance of ReturnError.



30
31
32
33
34
35
36
# File 'lib/bbk/amqp/publisher.rb', line 30

def initialize(exchange:, basic_return:, properties: , body: , **kwargs)
  @exchange = exchange
  @basic_return = basic_return
  @properties = properties
  @body = body
  super("Error on public message(headers=#{properties[:headers]}) to exchange(#{exchange.name}): #{basic_return}")
end

Instance Attribute Details

#basic_returnObject (readonly)

Returns the value of attribute basic_return.



28
29
30
# File 'lib/bbk/amqp/publisher.rb', line 28

def basic_return
  @basic_return
end

#bodyObject (readonly)

Returns the value of attribute body.



28
29
30
# File 'lib/bbk/amqp/publisher.rb', line 28

def body
  @body
end

#exchangeObject (readonly)

Returns the value of attribute exchange.



28
29
30
# File 'lib/bbk/amqp/publisher.rb', line 28

def exchange
  @exchange
end

#propertiesObject (readonly)

Returns the value of attribute properties.



28
29
30
# File 'lib/bbk/amqp/publisher.rb', line 28

def properties
  @properties
end