lib/almanack/event_source/meetup_group.rb in almanack-1.1.3 vs lib/almanack/event_source/meetup_group.rb in almanack-1.1.5

- old
+ new

@@ -1,9 +1,10 @@ module Almanack module EventSource class MeetupGroup def initialize(options = {}) + warn "Meetup have disabled support for API keys. Read more at https://github.com/Aupajo/almanack/issues/36" @request_options = options @group_properties = {} end def events_between(date_range) @@ -106,13 +107,23 @@ def response response = connection.get(uri) data = JSON.parse(response.body) if data['problem'] - raise MeetupAPIError, data['problem'] + raise MeetupAPIError, error_message_from(data) end data + end + + def error_message_from(data) + message = [data['problem'], data['details']].compact.join(' - ') + + if message.include?('not authorized') + message << ' ⚠️ See https://github.com/Aupajo/almanack/issues/36 for more details' + end + + message end end end end