Exception: Promiscuous::Error::Publisher

Inherits:
Base
  • Object
show all
Defined in:
lib/promiscuous/error/publisher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inner, options = {}) ⇒ Publisher

Returns a new instance of Publisher.



4
5
6
7
8
9
10
11
# File 'lib/promiscuous/error/publisher.rb', line 4

def initialize(inner, options={})
  super(nil)
  inner = inner.inner if inner.is_a?(Promiscuous::Error::Publisher)
  set_backtrace(inner.backtrace)
  self.inner = inner
  self.instance = options[:instance]
  self.payload  = options[:payload]
end

Instance Attribute Details

#innerObject

Returns the value of attribute inner.



2
3
4
# File 'lib/promiscuous/error/publisher.rb', line 2

def inner
  @inner
end

#instanceObject

Returns the value of attribute instance.



2
3
4
# File 'lib/promiscuous/error/publisher.rb', line 2

def instance
  @instance
end

#payloadObject

Returns the value of attribute payload.



2
3
4
# File 'lib/promiscuous/error/publisher.rb', line 2

def payload
  @payload
end

Instance Method Details

#messageObject Also known as: to_s



13
14
15
16
17
18
# File 'lib/promiscuous/error/publisher.rb', line 13

def message
  msg = "#{inner.class}: #{inner.message}"
  msg = "#{msg} while publishing #{instance.inspect}" if instance
  msg = "#{msg} payload: #{payload}" if payload
  msg
end