lib/mini_mediainfo/media.rb in mini_mediainfo-0.0.2 vs lib/mini_mediainfo/media.rb in mini_mediainfo-0.0.3
- old
+ new
@@ -13,11 +13,11 @@
unless File.exists?(uri)
if uri =~ URI::regexp(["ftp", "http", "https"])
url = URI.parse(uri)
req = Net::HTTP.new(url.host, url.port)
res = req.request_head(url.path)
- if res.code != "200"
- raise "Error: #{uri} is not accessible"
+ if res.code >= "400"
+ raise "Error: #{uri} is not accessible, status: #{res.code}"
end
else
raise "Error: the file '#{uri}' does not exist"
end
end