buntine/discogs — Issue #5: Unable to begin rescue => e through wrapper.get_artist("blah")
Author: kfam
Created: 2011-12-22 11:47:33+00:00
State: open

Hello again,

I've installed the gem in Win7 and works file (I've opened an issue about loading the gem in OSx ), I'm able to pick artists if they are found. But,
Trying to collect data from the database though, when the artist is not found results in with the following error which terminates the program: Discogs::UnkownResource

C:/tools/Ruby193/lib/ruby/gems/1.9.1/gems/discogs-wrapper-1.1.2/lib/wrapper/wrapper.rb:103:in `raise_unknown_resource': Unknown Discogs resource: artist/Beyonce (Discogs::UnknownResource)
from C:/tools/Ruby193/lib/ruby/gems/1.9.1/gems/discogs-wrapper-1.1.2/lib/wrapper/wrapper.rb:59:in `query_api'
from C:/tools/Ruby193/lib/ruby/gems/1.9.1/gems/discogs-wrapper-1.1.2/lib/wrapper/wrapper.rb:50:in `query_and_build'
from C:/tools/Ruby193/lib/ruby/gems/1.9.1/gems/discogs-wrapper-1.1.2/lib/wrapper/wrapper.rb:30:in `get_artist'
from init.rb:12:in `block (2 levels) in

'
from C:/tools/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-mp3info-0.6.16/lib/mp3info.rb:305:in `open'
from init.rb:10:in `block in

'
from init.rb:9:in `each'
from init.rb:9:in `

'

Trying to catch it again does not solve the problem:

list = ["foo","bar", "blah" ]

list.each { | artist |
begin
wrapper.get_artist("#{ artist }")
rescue => e
case e
when Discogs::UnkownResource
puts 'Not found artists'
end
end

in a general catch all still the problem insists. (i.e. begin; ..... ;rescue; puts "Not found Artist"; end

Any help would be very much appreciated.

Thank you.