Skip to content

Commit

Permalink
rescue some Tinder errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cpjolicoeur committed Apr 25, 2010
1 parent c7855ef commit 4075db6
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/cerberus/publisher/campfire.rb
Expand Up @@ -15,14 +15,22 @@ def self.publish(state, manager, options)

subject,body = Cerberus::Publisher::Base.formatted_message(state, manager, options)

campfire = if token.nil?
Tinder::Campfire.new( subdomain, :token => token )
else
Tinder::Campfire.new( subdomain, :username => username, :password => password)
end
begin
campfire = if token.nil?
Tinder::Campfire.new( subdomain, :token => token )
else
Tinder::Campfire.new( subdomain, :username => username, :password => password)
end

puts "rooms: #{campfire.rooms.to_yaml}"

room = campfire.find_room_by_name( name )
room.speak( subject )
room.paste( body )
room = campfire.find_room_by_name( name )
room.speak( subject )
room.paste( body )
rescue Tinder::AuthenticationFailed
say("Campfire authentication error. Please check your login credentials in your config file.")
rescue Tinder::SSLRequiredError
say("Campfire SSL error")
end
end
end

0 comments on commit 4075db6

Please sign in to comment.