lib/fog/aliyun/models/storage/files.rb in fog-aliyun-0.3.19 vs lib/fog/aliyun/models/storage/files.rb in fog-aliyun-0.4.0
- old
+ new
@@ -69,15 +69,14 @@
:body => data.body,
:key => key
})
new(file_data)
rescue Exception => error
- case error.http_code.to_i
- when 404
- nil
- else
- raise(error)
+ if error.respond_to?(:http_code) && error.http_code.to_i == 404
+ nil
+ else
+ raise(error)
end
end
end
# @param options[Hash] No need to use
@@ -106,14 +105,13 @@
file_data = data.headers.merge({
:key => key
})
new(file_data)
rescue Exception => error
- case error.http_code.to_i
- when 404
- nil
- else
- raise(error)
+ if error.respond_to?(:http_code) && error.http_code.to_i == 404
+ nil
+ else
+ raise(error)
end
end
end
def new(attributes = {})