lib/songkickr/remote.rb in songkickr-0.2.1 vs lib/songkickr/remote.rb in songkickr-0.2.2
- old
+ new
@@ -48,10 +48,11 @@
# === Parameters
# * +event_id+ - Songkick event ID. Extract the event ID either from a previous API call or from the URL of the event page on the website.
def event(event_id)
result = self.class.get("/events/#{event_id}.json")
# and now for some dirrty hack
+ raise ResouceNotFound if result['resultsPage']['error']
Songkickr::Event.new result["resultsPage"]["results"]["event"]
end
# ==== Gigography API
# http://groups.google.com/group/songkick-api/browse_thread/thread/af15b9a6ad3c3513#
@@ -171,9 +172,10 @@
# === Parameters
#
# * +venue_id+ - Songkick venue ID.
def venue(venue_id)
result = self.class.get("/venues/#{venue_id}.json")
+ raise ResouceNotFound if result['resultsPage']['error']
Songkickr::Venue.new result['resultsPage']['results']['venue']
end
private