Exception: ShellException
- Inherits:
-
CeedlingException
- Object
- RuntimeError
- CeedlingException
- ShellException
- Defined in:
- lib/ceedling/exceptions.rb
Instance Attribute Summary collapse
-
#shell_result ⇒ Object
readonly
Returns the value of attribute shell_result.
Instance Method Summary collapse
-
#initialize(shell_result: {}, name:, message: '') ⇒ ShellException
constructor
A new instance of ShellException.
Constructor Details
#initialize(shell_result: {}, name:, message: '') ⇒ ShellException
Returns a new instance of ShellException.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ceedling/exceptions.rb', line 20 def initialize(shell_result:{}, name:, message:'') @shell_result = shell_result = '' # Most shell exceptions will be from build compilation and linking. # The formatting of these messages should place the tool output on its own # lines without any other surrounding characters. # This formatting maximizes the ability of IDEs to parse, highlight, and make # actionable the build errors that appear within their terminal windows. # If shell results exist, report the exit code... if !shell_result.empty? = "#{name} terminated with exit code [#{shell_result[:exit_code]}]" if !shell_result[:output].empty? += " and output >>\n#{shell_result[:output].strip()}" end # Otherwise, just report the exception message else = "#{name} encountered an error with output >>\n#{}" end # Hand the message off to parent Exception super( ) end |
Instance Attribute Details
#shell_result ⇒ Object (readonly)
Returns the value of attribute shell_result.
18 19 20 |
# File 'lib/ceedling/exceptions.rb', line 18 def shell_result @shell_result end |