Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Never inspect nil keys in exception messages

  • Loading branch information...
commit 187aad5bd4474f9167c08b89c4f61a83706900ff 1 parent 19ac001
@evan authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/memcached/memcached.rb
View
6 lib/memcached/memcached.rb
@@ -369,7 +369,7 @@ def replace(key, value, ttl=@default_ttl, marshal=true, flags=FLAGS)
value = marshal ? Marshal.dump(value) : value
begin
check_return_code(
- Lib.memcached_replace(@struct, key, value, ttl, flags),
+ Lib.memcached_replace(@struct, key, value, ttl, flags),
key
)
rescue => e
@@ -613,7 +613,7 @@ def check_return_code(ret, key = nil) #:doc:
end
def reraise(key, ret)
- message = "Key #{inspect_keys(key, (detect_failure if ret == Lib::MEMCACHED_SERVER_MARKED_DEAD)).inspect}"
+ message = "Key #{inspect_keys(key, (detect_failure if ret == Lib::MEMCACHED_SERVER_MARKED_DEAD)).inspect}" if key
if key.is_a?(String)
if ret == Lib::MEMCACHED_ERRNO
if (server = Lib.memcached_server_by_key(@struct, key)).is_a?(Array)
@@ -622,7 +622,7 @@ def reraise(key, ret)
end
elsif ret == Lib::MEMCACHED_SERVER_ERROR
if (server = Lib.memcached_server_by_key(@struct, key)).is_a?(Array)
- message = "\"#{server.first.cached_server_error}\". #{message}."
+ message = "\"#{server.first.cached_server_error}\". #{message}"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.