Exception: Async::Stop
- Inherits:
-
Exception
- Object
- Exception
- Async::Stop
- Defined in:
- lib/async/stop.rb
Overview
Raised when a task is explicitly stopped.
Defined Under Namespace
Instance Method Summary collapse
-
#cause ⇒ Object
This is a compatibility method for Ruby versions before 3.5 where cause is not propagated correctly when using Fiber#raise, we explicitly capture the cause here.
-
#initialize(message = "Task was stopped") ⇒ Stop
constructor
Create a new stop operation.
Constructor Details
#initialize(message = "Task was stopped") ⇒ Stop
Create a new stop operation.
This is a compatibility method for Ruby versions before 3.5 where cause is not propagated correctly when using Fiber#raise
43 44 45 46 47 48 49 50 |
# File 'lib/async/stop.rb', line 43 def initialize( = "Task was stopped") if .is_a?(Hash) @cause = [:cause] = "Task was stopped" end super() end |
Instance Method Details
#cause ⇒ Object
This is a compatibility method for Ruby versions before 3.5 where cause is not propagated correctly when using Fiber#raise, we explicitly capture the cause here.
55 56 57 |
# File 'lib/async/stop.rb', line 55 def cause super || @cause end |