Exception: SimpleFuture::ChildError
- Defined in:
- lib/simple-future.rb
Overview
Exception class for the case where an uncaught exception is thrown in the child process.
Instance Attribute Summary collapse
-
#cause ⇒ Object
readonly
If the child process threw an exception, this is it.
Instance Method Summary collapse
-
#initialize(msg, cause = nil) ⇒ ChildError
constructor
A new instance of ChildError.
- #to_s ⇒ Object
Constructor Details
#initialize(msg, cause = nil) ⇒ ChildError
Returns a new instance of ChildError.
52 53 54 55 |
# File 'lib/simple-future.rb', line 52 def initialize(msg, cause = nil) super(msg) @cause = cause end |
Instance Attribute Details
#cause ⇒ Object (readonly)
If the child process threw an exception, this is it. Otherwise, it's nil.
48 49 50 |
# File 'lib/simple-future.rb', line 48 def cause @cause end |
Instance Method Details
#to_s ⇒ Object
57 58 59 60 61 |
# File 'lib/simple-future.rb', line 57 def to_s result = super.to_s result += " (cause: #{cause.class} '#{@cause.to_s}')" if @cause return result end |