lib/totrello.rb in totrello-0.1.0 vs lib/totrello.rb in totrello-0.1.1a

- old
+ new

@@ -31,18 +31,26 @@ todo = ToDoFind.new todos = todo.search(@directory) puts "Woot! We've got'em" puts 'Generating your board' - board = @trello.find_board(todos[:directory]) - board ||= @trello.create_board(todos[:directory], 'Auto Generated by ToTrello Gem') + begin + board = @trello.find_board(todos[:directory]) + rescue + board ||= @trello.create_board(todos[:directory], 'Auto Generated by ToTrello Gem') + end puts 'Taking to Trello, this is the longest part...' todos[:todo_list].each do |tdl| tdl[:todos].each do |td| - @trello.create_card(board,td, gen_description(tdl[:file],td),'To Do') unless td == '' + begin + @trello.create_card(board,td, gen_description(tdl[:file],td),'To Do') unless td == '' + rescue + puts 'error posting to trello' + end + end end puts "And you're ready to go!" end