def do_work(&block)
connect
begin
block.call
rescue Twitter::RateExceeded
say("Twitter says you've been making too many requests. Wait for a bit and try again.")
rescue Twitter::Unavailable
say("Twitter is unavailable right now. Try again later.")
rescue Twitter::CantConnect => msg
say("Can't connect to twitter because: #{msg}")
rescue Twitter::CLI::Helpers::NoActiveAccount
say("You have not set an active account. Use 'twitter change' to set one now.")
rescue Twitter::CLI::Helpers::NoAccounts
unless attempt_import { block.call }
say("You have not created any accounts. Use 'twitter add' to create one now.")
end
end
end