Sha256: 7f7215b4c122a5910da8c87fd660b5ab86f75388b5482185038f14ebfef5ff18

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

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

  class MissingNodeManagerError < Error
    def initialize(timeout)
      super("Failed to hear from Node Manager within #{timeout} seconds")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redis_failover-0.7.0 lib/redis_failover/errors.rb
redis_failover-0.6.0 lib/redis_failover/errors.rb
redis_failover-0.5.4 lib/redis_failover/errors.rb
redis_failover-0.5.3 lib/redis_failover/errors.rb