lib/nightcrawler_swift/commands/download.rb in nightcrawler_swift-0.4.0 vs lib/nightcrawler_swift/commands/download.rb in nightcrawler_swift-0.5.0
- old
+ new
@@ -1,16 +1,14 @@
module NightcrawlerSwift
class Download < Command
def execute path
+ if path.nil? or path.empty?
+ raise Exceptions::ValidationError.new "Download command requires a path parameter"
+ end
+
response = get "#{connection.public_url}/#{options.bucket}/#{path}"
response.body
-
- rescue RestClient::ResourceNotFound => e
- raise Exceptions::NotFoundError.new(e)
-
- rescue StandardError => e
- raise Exceptions::ConnectionError.new(e)
end
end
end