class Cassandra::Errors::NoHostsAvailable

This error is thrown when all attempted hosts raised a {Cassandra::Errors::HostError} during connection or query execution.

@see Cassandra::Cluster#connect @see Cassandra::Session#execute

Attributes

errors[R]

@return [Hash{Cassandra::Host => Cassandra::Errors::HostError}] a map

of hosts to underlying exceptions

Public Class Methods

new(errors = nil) click to toggle source

@private

Calls superclass method
    # File lib/cassandra/errors.rb
761 def initialize(errors = nil)
762   if errors
763     first   = true
764     message = 'All attempted hosts failed'
765     errors.each do |(host, error)|
766       if first
767         first = false
768         message << ': '
769       else
770         message << ', '
771       end
772       message << "#{host.ip} (#{error.class.name}: #{error.message})"
773     end
774   else
775     message = 'All hosts down'
776   end
777 
778   super(message)
779 
780   @errors = errors || {}
781 end