Skip to content

Commit

Permalink
Use global scope to find Error classes (thanks to @wr0ngway)
Browse files Browse the repository at this point in the history
Change-Id: I6b9bb24d2bda03f298d3f67cb9ff0f9458713abe
Reviewed-on: http://review.couchbase.org/21362
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Chris Anderson <jchris@couchbase.com>
  • Loading branch information
avsej committed Oct 8, 2012
1 parent 42a0e40 commit 477e510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/active_support/cache/couchbase_store.rb
Expand Up @@ -184,7 +184,7 @@ def read_multi(*names)
instrument(:read_multi, names, options) do
@data.get(names, options)
end
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
false
Expand Down Expand Up @@ -245,7 +245,7 @@ def increment(name, amount = 1, options = nil)
payload[:amount] = amount if payload
@data.incr(name, amount, options)
end
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
false
Expand Down Expand Up @@ -277,7 +277,7 @@ def decrement(name, amount = 1, options = nil)
payload[:amount] = amount if payload
@data.decr(name, amount, options)
end
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
false
Expand All @@ -297,7 +297,7 @@ def stats(*arg)
# Read an entry from the cache.
def read_entry(key, options) # :nodoc:
@data.get(key, options)
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
nil
Expand All @@ -314,7 +314,7 @@ def write_entry(key, value, options) # :nodoc:
options[:ttl] ||= ttl
end
@data.send(method, key, value, options)
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
false
Expand All @@ -323,7 +323,7 @@ def write_entry(key, value, options) # :nodoc:
# Delete an entry from the cache.
def delete_entry(key, options) # :nodoc:
@data.delete(key, options)
rescue Couchbase::Error::Base => e
rescue ::Couchbase::Error::Base => e
logger.error("#{e.class}: #{e.message}") if logger
raise if @raise_errors
false
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/session/couchbase.rb
Expand Up @@ -90,7 +90,7 @@ def destroy_session(env, session_id, options)
def with_lock(env, default = nil)
@mutex.lock if env['rack.multithread']
yield
rescue Couchbase::Error::Connect, Couchbase::Error::Timeout
rescue ::Couchbase::Error::Connect, ::Couchbase::Error::Timeout
if $VERBOSE
warn "#{self} is unable to find Couchbase server."
warn $!.inspect
Expand Down

0 comments on commit 477e510

Please sign in to comment.