我一直在使用eventbrite和eventful apis,因为我对请求更加具体,api错误输出无法执行任务的api。我希望它跳过该错误并仍然执行剩余的api。如果一个失败,我如何提出异常?
我的代码:
#eventbrite api
@eb_auth_tokens = { app_key: 'TN7HUH76XZTXHI2AV5'
}
@eb_client = EventbriteClient.new(@eb_auth_tokens)
@event_search = @eb_client.event_search(
#city: "syracuse",
postal_code: "13201",
within: "1",
within_unit: "M",
date: "2013-06-19 2013-06-25",
#keywords: "business, economy",
max: "100"
)
#eventful api
client = EventfulApi::Client.new(:oauth_token => 'token', :oauth_secret => 'token secret')
response_hash = client.get('/events/search/', {
location: "10007",
within: "200",
units: "mi",
date: '2013061900-2013062700',
#keywords: "business,economy",
#sort_order: "date",
page_size: '15'
})
events =response_hash['events']
@perevents = events['event']