lib/riak/bucket.rb in riak-client-0.9.0.beta vs lib/riak/bucket.rb in riak-client-0.9.0.beta2
- old
+ new
@@ -111,10 +111,10 @@
# @return [RObject] the new or existing object
def get_or_new(key, options={})
begin
get(key, options)
rescue Riak::FailedRequest => fr
- if fr.code.to_i == 404
+ if fr.not_found?
new(key)
else
raise fr
end
end