Forum: Ruby on Rails Catching Errors with Flickr API

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bd48c6aec7f4341c92fba616ebc61a5b?d=identicon&s=25 Jordan Isip (jtei)
on 2006-05-30 09:07
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: <p>This is the static image URL: <%=@img.source(size='Medium') %></p>
7:
8: <p>Owner: <%= @owner %></p>
***

Thanks in advance for your help!
This topic is locked and can not be replied to.