lib/memcached/memcached.rb
# Checks the return code from Rlibmemcached against the exception list. Raises the corresponding exception if the return code is not Memcached::Success or Memcached::ActionQueued. Accepts an integer return code and an optional key, for exception messages.
Checks the return code from Rlibmemcached against the exception list. Raises the corresponding exception if the return code is not Memcached::Success or Memcached::ActionQueued. Accepts an integer return code and an optional key, for exception messages.
Checks the return code from Rlibmemcached against the exception list . Raises the corresponding exception if the return code is not Memcached :: Success or Memcached :: ActionQueued . Accepts an integer return code and an optional key for exception messages .
def check_return_code(ret, key = nil) 
    if ret == 0 
    elsif ret == Lib::MEMCACHED_BUFFERED 
    elsif ret == Lib::MEMCACHED_NOTFOUND and @not_found
      raise @not_found
    elsif ret == Lib::MEMCACHED_NOTSTORED and @not_stored
      raise @not_stored
    else
      message = "Key #{inspect_keys(key, (detect_failure if ret == Lib::MEMCACHED_SERVER_MARKED_DEAD)).inspect}"
      if key.is_a?(String)
        if ret == Lib::MEMCACHED_ERRNO
          server = Lib.memcached_server_by_key(@struct, key)
          errno = server.first.cached_errno
          message = "Errno #{errno}: #{ERRNO_HASH[errno].inspect}. #{message}"
        elsif ret == Lib::MEMCACHED_SERVER_ERROR
          server = Lib.memcached_server_by_key(@struct, key)
          message = "\"#{server.first.cached_server_error}\". #{message}."
        end
      end
      raise EXCEPTIONS[ret], message
    end
  end
def check_return_code ( ret , key = nil ) if ret == 0 elsif ret == Lib :: MEMCACHED_BUFFERED elsif ret == Lib :: MEMCACHED_NOTFOUND and @not_found raise @not_found elsif ret == Lib :: MEMCACHED_NOTSTORED and @not_stored raise @not_stored else message = "Key #{inspect_keys(key, (detect_failure if ret == Lib::MEMCACHED_SERVER_MARKED_DEAD)).inspect}" if key . is_a? ( String ) if ret == Lib :: MEMCACHED_ERRNO server = Lib . memcached_server_by_key ( @struct , key ) errno = server . first . cached_errno message = "Errno #{errno}: #{ERRNO_HASH[errno].inspect}. #{message}" elsif ret == Lib :: MEMCACHED_SERVER_ERROR server = Lib . memcached_server_by_key ( @struct , key ) message = "\"#{server.first.cached_server_error}\". #{message}." end end raise EXCEPTIONS [ ret ] , message end end
Checks the return code from Rlibmemcached against the exception list.
Checks the return code from Rlibmemcached against the exception list .
#:doc: # Memcached::Success # Memcached::ActionQueued
ret
key