Exception: CMD::Timeout
- Inherits:
-
ProcessFailed
- Object
- StandardError
- ProcessFailed
- CMD::Timeout
- Defined in:
- lib/scout/cmd.rb
Overview
ScoutCoder: exception raised by CMD.cmd when a command exceeds its :timeout option. It subclasses ProcessFailed, so generic rescue clauses for ProcessFailed also catch it. In pipe mode the stream is aborted with this exception (ConcurrentStream#abort), so consumers observe it through ConcurrentStream#stream_raise_exception when reading or joining the returned stream.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Attributes inherited from ProcessFailed
Instance Method Summary collapse
-
#initialize(pid = Process.pid, command = nil, timeout = nil) ⇒ Timeout
constructor
A new instance of Timeout.
Constructor Details
#initialize(pid = Process.pid, command = nil, timeout = nil) ⇒ Timeout
Returns a new instance of Timeout.
24 25 26 27 28 |
# File 'lib/scout/cmd.rb', line 24 def initialize(pid = Process.pid, command = nil, timeout = nil) @command = command @timeout = timeout super(pid, "command '#{command}' exceeded timeout of #{timeout} seconds") end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
23 24 25 |
# File 'lib/scout/cmd.rb', line 23 def command @command end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
23 24 25 |
# File 'lib/scout/cmd.rb', line 23 def timeout @timeout end |