Exception: Braid::Operations::ShellExecutionError
- Inherits:
-
BraidError
- Object
- StandardError
- BraidError
- Braid::Operations::ShellExecutionError
- Defined in:
- lib/braid/operations.rb
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
Instance Method Summary collapse
-
#initialize(err = nil, out = nil) ⇒ ShellExecutionError
constructor
A new instance of ShellExecutionError.
- #message ⇒ Object
Methods included from T::Sig
Constructor Details
#initialize(err = nil, out = nil) ⇒ ShellExecutionError
Returns a new instance of ShellExecutionError.
18 19 20 21 |
# File 'lib/braid/operations.rb', line 18 def initialize(err = nil, out = nil) @err = err @out = out end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
15 16 17 |
# File 'lib/braid/operations.rb', line 15 def err @err end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
15 16 17 |
# File 'lib/braid/operations.rb', line 15 def out @out end |
Instance Method Details
#message ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/braid/operations.rb', line 24 def first_line = @err.to_s.split("\n").first # Currently, first_line can be nil if @err was empty, but Sorbet thinks # that the `message` method of an Exception should always return non-nil # (although override checking isn't enforced as of this writing), so # handle nil here. This seems ad-hoc but better than putting in a # `T.must` that we know has a risk of being wrong. Hopefully this will # be fixed better in https://github.com/cristibalan/braid/issues/90. first_line.nil? ? '' : first_line end |