lib/dl/dl.rb in dl-1.2.1 vs lib/dl/dl.rb in dl-1.2.2

- old
+ new

@@ -4,31 +4,14 @@ output "Downloading #{url}..." begin response = session.get url - rescue Patron::HostResolutionError - puts "Error resolving remote host." + rescue Patron::Error => e + $stderr.puts e.message exit 1 - rescue Patron::PartialFileError - puts "File size mismatch. (Host reported a file size, but the actual file is of different size)" - exit 1 - rescue Patron::TimeoutError - puts "Operation timed out." - exit 1 - rescue Patron::TooManyRedirects - puts "Tried redirecting too many times." - exit 1 - rescue Patron::URLFormatError - puts "Error with the URL format" - exit 1 - rescue Patron::UnsupportedProtocol - puts "This URL is using a protocol that we cannot handle." - exit 1 - rescue Patron::ConnectionFailed - puts "Error connecting to host. Check your internet connection." - exit 1 end + if raw == true puts response.body else if Dl::file != nil filename = Dl::file