Exception: Notify::DeliveryError

Inherits:
Error
  • Object
show all
Defined in:
lib/notify/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter_errors = {}) ⇒ DeliveryError

Returns a new instance of DeliveryError.



12
13
14
15
16
17
18
19
20
# File 'lib/notify/errors.rb', line 12

def initialize(adapter_errors = {})
  @adapter_errors = adapter_errors
  if adapter_errors.any?
    adapter_msgs = adapter_errors.map { |adapter, err| "#{adapter}: #{err.message}" }
    super("All adapters failed — #{adapter_msgs.join('; ')}")
  else
    super("All adapters failed")
  end
end

Instance Attribute Details

#adapter_errorsObject (readonly)

Returns the value of attribute adapter_errors.



10
11
12
# File 'lib/notify/errors.rb', line 10

def adapter_errors
  @adapter_errors
end