Skip to content

Commit

Permalink
rescue tweet duplicate error #10 #21
Browse files Browse the repository at this point in the history
  • Loading branch information
shokai committed Oct 10, 2012
1 parent 83a8bb9 commit a125ee4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/tw/app/cmds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ def regist_cmds
auth
STDIN.read.split(/[\r\n]+/).each do |line|
line.split(/(.{140})/u).select{|m|m.size>0}.each do |message|
client.tweet message
begin
client.tweet message
rescue => e
STDERR.puts e.message
end
end
sleep 1
end
Expand Down
6 changes: 5 additions & 1 deletion lib/tw/app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ def run(argv)
puts '[Y/n]'
on_exit if STDIN.gets.strip =~ /^n/i
end
client.tweet message
begin
client.tweet message
rescue => e
STDERR.puts e.message
end
end
end

Expand Down

0 comments on commit a125ee4

Please sign in to comment.