Method: Climate.handle_error
- Defined in:
- lib/climate.rb
.handle_error(e, options) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/climate.rb', line 32 def self.handle_error(e, ) case e when ExitException # exit silently if there is no error message to print out stderr.puts(e.) if e. e.exit_code when HelpNeeded help(e.command_class).print() 0 when ParsingError stderr.puts([e.class].call(e)) help(e.command_class).print_usage 1 else stderr.puts("Unexpected error: #{e.class.name} - #{e.}") stderr.puts(e.backtrace) 2 end end |