Exception: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError
- Inherits:
-
StandardError
- Object
- StandardError
- InstanceAgent::Plugins::CodeDeployPlugin::ScriptError
- 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
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
-
#script_name ⇒ Object
readonly
Returns the value of attribute script_name.
Instance Method Summary collapse
-
#initialize(error_code, script_name, log) ⇒ ScriptError
constructor
A new instance of ScriptError.
- #to_json ⇒ Object
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_code ⇒ Object (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 |
#log ⇒ Object (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_name ⇒ Object (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_json ⇒ Object
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' => , 'log' => log}.to_json end |