Exception: AsyncFutures::InvalidStateError

Inherits:
Error
  • Object
show all
Defined in:
lib/async_futures/error.rb

Overview

Error raised for all invalid Future states.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(future, state) ⇒ InvalidStateError

Returns a new instance of InvalidStateError.



15
16
17
18
19
20
# File 'lib/async_futures/error.rb', line 15

def initialize(future, state)
  @future = future
  @state = state

  super("Unexpected state '#{@state}' for Future: #{@future}")
end

Instance Attribute Details

#futureObject (readonly)

Returns the value of attribute future.



13
14
15
# File 'lib/async_futures/error.rb', line 13

def future
  @future
end

#stateObject (readonly)

Returns the value of attribute state.



13
14
15
# File 'lib/async_futures/error.rb', line 13

def state
  @state
end