Exception: JetstreamBridge::BatchPublishError

Inherits:
PublishError show all
Defined in:
lib/jetstream_bridge/errors.rb

Instance Attribute Summary collapse

Attributes inherited from PublishError

#event_id, #subject

Attributes inherited from Error

#context

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, failed_events: [], successful_count: 0, context: {}) ⇒ BatchPublishError

Returns a new instance of BatchPublishError.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/jetstream_bridge/errors.rb', line 41

def initialize(message = nil, failed_events: [], successful_count: 0, context: {})
  @failed_events = failed_events
  @successful_count = successful_count
  super(
    message,
    context: context.merge(
      failed_count: failed_events.size,
      successful_count: successful_count
    )
  )
end

Instance Attribute Details

#failed_eventsObject (readonly)

Returns the value of attribute failed_events.



39
40
41
# File 'lib/jetstream_bridge/errors.rb', line 39

def failed_events
  @failed_events
end

#successful_countObject (readonly)

Returns the value of attribute successful_count.



39
40
41
# File 'lib/jetstream_bridge/errors.rb', line 39

def successful_count
  @successful_count
end