Class: NeetoDeploy::ExceptionHandler
- Defined in:
- lib/neeto_deploy/exception_handler.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
Returns the value of attribute exception.
Attributes inherited from CLI::Base
Instance Method Summary collapse
-
#initialize(exception) ⇒ ExceptionHandler
constructor
A new instance of ExceptionHandler.
- #process ⇒ Object
Methods inherited from CLI::Base
Constructor Details
#initialize(exception) ⇒ ExceptionHandler
Returns a new instance of ExceptionHandler.
9 10 11 12 |
# File 'lib/neeto_deploy/exception_handler.rb', line 9 def initialize(exception) super() @exception = exception end |
Instance Attribute Details
#exception ⇒ Object
Returns the value of attribute exception.
7 8 9 |
# File 'lib/neeto_deploy/exception_handler.rb', line 7 def exception @exception end |
Instance Method Details
#process ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/neeto_deploy/exception_handler.rb', line 14 def process case exception when Thor::RequiredArgumentMissingError ui.error( "#{exception.}."\ ' Please use the "help" command to check all the required options and try again.' ) when Errno::ENOENT ui.error( "#{exception.}."\ " Please check the given path and try again" ) when SystemExit ui.error( "Process exit with status code 1" ) else ui.error(exception.) end end |