Method: CloudstackClient::Cli.start
- Defined in:
- lib/cloudstack_client/cli.rb
.start(given_args = ARGV, config = {}) ⇒ Object
rescue error globally
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cloudstack_client/cli.rb', line 37 def self.start(given_args=ARGV, config={}) super rescue => e error_class = e.class.name.split('::') if error_class.size == 2 && error_class.first == "CloudstackClient" puts "\e[31mERROR\e[0m: #{error_class.last} - #{e.message}" puts e.backtrace if ARGV.include? "--debug" else raise end end |