Sha256: a2fdc45617ef86c5bade2a10602af61b4e1ce858ec8b769d450d1cf27663c629

Contents?: true

Size: 926 Bytes

Versions: 4

Compression:

Stored size: 926 Bytes

Contents

module RedisFailover
  class Error < StandardError
    attr_reader :original
    def initialize(msg = nil, original = $!)
      super(msg)
      @original = original
    end
  end

  class InvalidNodeError < Error
  end

  class InvalidNodeStateError < Error
    def initialize(node, state)
      super("Invalid state change `#{state}` for node #{node}")
    end
  end

  class NodeUnavailableError < Error
    def initialize(node)
      super("Node: #{node}")
    end
  end

  class NoMasterError < Error
  end

  class NoSlaveError < Error
  end

  class InvalidNodeRoleError < Error
    def initialize(node, assumed, actual)
      super("Invalid role detected for node #{node}, client thought " +
        "it was a #{assumed}, but it's now a #{actual}")
    end
  end

  class UnsupportedOperationError < Error
    def initialize(operation)
      super("Operation `#{operation}` is currently unsupported")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redis_failover-0.8.0 lib/redis_failover/errors.rb
redis_failover-0.5.2 lib/redis_failover/errors.rb
redis_failover-0.5.1 lib/redis_failover/errors.rb
redis_failover-0.5.0 lib/redis_failover/errors.rb