Exception: RedisClient::CommandError
- Includes:
- Final, HasCode, HasCommand
- Defined in:
- lib/redis_client.rb
Constant Summary collapse
- ERRORS =
{ "WRONGPASS" => AuthenticationError, "NOPERM" => PermissionError, "READONLY" => ReadOnlyError, "MASTERDOWN" => MasterDownError, "WRONGTYPE" => WrongTypeError, "OOM" => OutOfMemoryError, "NOSCRIPT" => NoScriptError, }.freeze
Instance Attribute Summary
Attributes included from HasCode
Attributes included from HasCommand
Attributes included from HasConfig
Class Method Summary collapse
Methods included from Final
#_set_retry_attempt, #final?, #retriable?, #retry_attempt
Methods included from HasCode
Methods included from HasCommand
Methods inherited from Error
Methods included from Retriable
#_set_retry_attempt, #final?, #retriable?, #retry_attempt
Methods included from HasConfig
Class Method Details
.parse(error_message) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/redis_client.rb', line 184 def parse() code = if .start_with?("ERR Error running script") # On older redis servers script errors are nested. # So we need to parse some more. if (match = .match(/:\s-([A-Z]+) /)) match[1] end end code ||= .split(' ', 2).first klass = ERRORS.fetch(code, self) klass.new(.strip, code.freeze) end |