Class: RedisClient::Cluster::ErrorCollection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ErrorCollection



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/redis_client/cluster/errors.rb', line 32

def initialize(errors)
  @errors = {}
  if !errors.is_a?(Hash) || errors.empty?
    super(errors.to_s)
    return
  end

  @errors = errors
  messages = @errors.map { |node_key, error| "#{node_key}: #{error.message}" }
  super("Errors occurred on any node: #{messages.join(', ')}")
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



30
31
32
# File 'lib/redis_client/cluster/errors.rb', line 30

def errors
  @errors
end