lib/models/music_brainz.rb in musicbrainz-0.4.5 vs lib/models/music_brainz.rb in musicbrainz-0.4.6
- old
+ new
@@ -12,10 +12,10 @@
5.times do
begin
response = open(url, "User-Agent" => "gem musicbrainz (https://github.com/magnolia-fan/musicbrainz) @ " + Socket.gethostname)
@@last_query_time = Time.now.to_f
rescue => e
- # MusicBrainz: 503
+ return nil if e.io.status[0].to_i == 404
end
break unless response.nil?
end
response
end