Module: Twat::Exceptions

Included in:
Config, Options, Subcommands::Base
Defined in:
lib/twat/exceptions.rb

Defined Under Namespace

Classes: AlreadyConfigured, ArgumentRequired, ConfigVersionIncorrect, InvalidBool, InvalidCredentials, InvalidInt, InvalidSetOpt, NoConfigFile, NoDefaultAccount, NoInternetConnection, NoSuchAccount, NoSuchCommand, NoSuchEndpoint, NoSuchTweet, RequiresOptVal, TwatException, TweetTooLong, Usage

Instance Method Summary collapse

Instance Method Details

#with_handled_exceptions(opts = nil) ⇒ Object



91
92
93
94
95
96
97
98
99
# File 'lib/twat/exceptions.rb', line 91

def with_handled_exceptions(opts=nil)
  begin
    yield
  rescue Usage
    opts.usage if opts
  rescue TwatException => e
    puts e.msg
  end
end