Forum: Ruby on Rails Catching Errors with Flickr API

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jordan I. (Guest)
on 2006-05-30 11: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>
8: <p>Owner: <%= @owner %></p>

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