Exception: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/instance_agent/plugins/codedeploy/hook_executor.rb

Constant Summary collapse

SUCCEEDED_CODE =
0
SCRIPT_MISSING_CODE =
1
SCRIPT_EXECUTABILITY_CODE =
2
SCRIPT_TIMED_OUT_CODE =
3
SCRIPT_FAILED_CODE =
4
UNKNOWN_ERROR_CODE =
5

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code, script_name, log) ⇒ ScriptError

Returns a new instance of ScriptError.



46
47
48
49
50
# File 'lib/instance_agent/plugins/codedeploy/hook_executor.rb', line 46

def initialize(error_code, script_name, log)
  @error_code = error_code
  @script_name = script_name
  @log = log
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



38
39
40
# File 'lib/instance_agent/plugins/codedeploy/hook_executor.rb', line 38

def error_code
  @error_code
end

#logObject (readonly)

Returns the value of attribute log.



38
39
40
# File 'lib/instance_agent/plugins/codedeploy/hook_executor.rb', line 38

def log
  @log
end

#script_nameObject (readonly)

Returns the value of attribute script_name.



38
39
40
# File 'lib/instance_agent/plugins/codedeploy/hook_executor.rb', line 38

def script_name
  @script_name
end

Instance Method Details

#to_jsonObject



52
53
54
55
56
57
# File 'lib/instance_agent/plugins/codedeploy/hook_executor.rb', line 52

def to_json
  log = @log.log || []
  log = log.join("")
  log.force_encoding("utf-8")
  {'error_code' => @error_code, 'script_name' => @script_name, 'message' => message, 'log' => log}.to_json
end