lib/bukkit/download.rb in bukkit-0.1.2 vs lib/bukkit/download.rb in bukkit-0.1.3

- old
+ new

@@ -1,9 +1,13 @@ require 'open-uri' module Bukkit def self.download(filename, uri) - File.open("#{filename}", "wb") do |file| - file.write open("#{uri}").read + begin + File.open("#{filename}", "wb") do |file| + file.write open("#{uri}").read + end + rescue Errno::ENOENT + abort "Error! No internet connection." end end end \ No newline at end of file