Exception: Yapo::Helpers::CustomErrors::CommandError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Yapo::Helpers::CustomErrors::CommandError
- Defined in:
- lib/yapo/helpers/custom_errors.rb
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(command, result, *args) ⇒ CommandError
constructor
A new instance of CommandError.
- #message ⇒ Object
Constructor Details
#initialize(command, result, *args) ⇒ CommandError
Returns a new instance of CommandError.
47 48 49 50 51 52 53 54 |
# File 'lib/yapo/helpers/custom_errors.rb', line 47 def initialize(command, result, *args) @command = command @params = *args @exit_status = result.exit_status @out = result.out @err = result.err ErrorMessage.new.print() end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
45 46 47 |
# File 'lib/yapo/helpers/custom_errors.rb', line 45 def err @err end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
45 46 47 |
# File 'lib/yapo/helpers/custom_errors.rb', line 45 def exit_status @exit_status end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
45 46 47 |
# File 'lib/yapo/helpers/custom_errors.rb', line 45 def out @out end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
45 46 47 |
# File 'lib/yapo/helpers/custom_errors.rb', line 45 def params @params end |
Instance Method Details
#message ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/yapo/helpers/custom_errors.rb', line 56 def "The command you are tying to execute is not valid. Please verify it works in your terminal first.\n" \ "Running \"#{@command}\" failed with exit status #{@exit_status}.\n" \ " params: #{@params}\n" \ " std out: #{@out}\n" \ " std err: #{@err}\n" end |