Catching Errors with Flickr API


#1

Hi Everyone,

I am playing around with the flickr API and I was wondering if it is
possbile to catch errors. I am using owner method (flickr :: photo) to
display the owner of the flickr photo’s name. However, at times (works
when it can find an owner), I get this error when loading the photo
(with attributes):


TypeError in Flickrtest#show
Showing app/views/flickrtest/_photo.rhtml where line #8 raised:
cannot convert Hash into String

Extracted source (around line #8):
6:

This is the static image URL: <%=@img.source(size=‘Medium’) %>


7:
8:

Owner: <%= @owner %>


Thanks in advance for your help!