Sha256: 7e56a54f7d211715abb4e1a10927b51709cc25535c60283f3bdfbaba0d327528

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

class Redis
  # Base error for all redis-rb errors.
  class BaseError < StandardError
  end

  # Raised by the connection when a protocol error occurs.
  class ProtocolError < BaseError
    def initialize(reply_type)
      super(<<-EOS.gsub(/(?:^|\n)\s*/, " "))
        Got '#{reply_type}' as initial reply byte.
        If you're in a forking environment, such as Unicorn, you need to
        connect to Redis after forking.
      EOS
    end
  end

  # Raised by the client when command execution returns an error reply.
  class CommandError < BaseError
  end

  class PermissionError < CommandError
  end

  class WrongTypeError < CommandError
  end

  class ReadOnlyError < CommandError
  end

  # Base error for connection related errors.
  class BaseConnectionError < BaseError
  end

  # Raised when connection to a Redis server cannot be made.
  class CannotConnectError < BaseConnectionError
  end

  # Raised when connection to a Redis server is lost.
  class ConnectionError < BaseConnectionError
  end

  # Raised when performing I/O times out.
  class TimeoutError < BaseConnectionError
  end

  # Raised when the connection was inherited by a child process.
  class InheritedError < BaseConnectionError
  end

  # Raised when client options are invalid.
  class InvalidClientOptionError < BaseError
  end

  class SubscriptionError < BaseError
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
redis-5.0.2 lib/redis/errors.rb
redis-5.0.1 lib/redis/errors.rb
redis-5.0.0 lib/redis/errors.rb
redis-5.0.0.beta4 lib/redis/errors.rb