Exception: Lazy::LazyException

Inherits:
DivergenceError show all
Defined in:
lib/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

Instance Method Summary collapse

Constructor Details

#initialize(reason) ⇒ LazyException

Returns a new instance of LazyException.



33
34
35
36
37
# File 'lib/lazy.rb', line 33

def initialize( reason )
  @reason = reason
  super( "Exception in lazy computation: #{ reason } (#{ reason.class })" )
  set_backtrace( reason.backtrace.dup ) if reason
end

Instance Attribute Details

#reasonObject (readonly)

the original exception



31
32
33
# File 'lib/lazy.rb', line 31

def reason
  @reason
end