Exception: Cocov::PluginKit::Exec::ExecutionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cocov/plugin_kit/exec.rb

Overview

ExecutionError is thrown when an #exec or #exec2 procedure fails. It includes the captured stdout and stderr streams, along with the exit status, the original command and its environment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, stdout, stderr, cmd, env) ⇒ ExecutionError

Internal: Initializes a new ExecutionError instance



14
15
16
17
18
19
20
21
# File 'lib/cocov/plugin_kit/exec.rb', line 14

def initialize(status, stdout, stderr, cmd, env)
  super("Process #{cmd.split.first} exited with status #{status}: #{stdout}\n#{stderr}")
  @status = status
  @stdout = stdout
  @stderr = stderr
  @cmd = cmd
  @env = env
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



11
12
13
# File 'lib/cocov/plugin_kit/exec.rb', line 11

def cmd
  @cmd
end

#envObject (readonly)

Returns the value of attribute env.



11
12
13
# File 'lib/cocov/plugin_kit/exec.rb', line 11

def env
  @env
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/cocov/plugin_kit/exec.rb', line 11

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



11
12
13
# File 'lib/cocov/plugin_kit/exec.rb', line 11

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



11
12
13
# File 'lib/cocov/plugin_kit/exec.rb', line 11

def stdout
  @stdout
end