Exception: Lazy::LazyException
- Inherits:
-
DivergenceError
- Object
- Exception
- DivergenceError
- Lazy::LazyException
- Defined in:
- lib/core/facets/lazy.rb
Overview
Wraps an exception raised by a lazy computation.
The reason we wrap such exceptions in LazyException is that they need to be distinguishable from similar exceptions which might normally be raised by whatever strict code we happen to be in at the time.
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
the original exception.
Instance Method Summary collapse
-
#initialize(reason) ⇒ LazyException
constructor
A new instance of LazyException.
Methods inherited from Exception
#detail, #error_print, error_print, raised?, #set_message, suppress
Constructor Details
#initialize(reason) ⇒ LazyException
Returns a new instance of LazyException.
46 47 48 49 50 |
# File 'lib/core/facets/lazy.rb', line 46 def initialize( reason ) @reason = reason super( "Exception in lazy computation: #{ reason } (#{ reason.class })" ) set_backtrace( reason.backtrace.dup ) if reason end |
Instance Attribute Details
#reason ⇒ Object (readonly)
the original exception
44 45 46 |
# File 'lib/core/facets/lazy.rb', line 44 def reason @reason end |