diff --git a/lib/moonshot/deployment_mechanism/code_deploy.rb b/lib/moonshot/deployment_mechanism/code_deploy.rb index 3c337d11..5ce22ba8 100644 --- a/lib/moonshot/deployment_mechanism/code_deploy.rb +++ b/lib/moonshot/deployment_mechanism/code_deploy.rb @@ -307,9 +307,13 @@ def handle_deployment_failure(deployment_id) inst_summary.lifecycle_events.each do |event| next unless event.status == 'Failed' - ilog.error(event.diagnostics.message) - event.diagnostics.log_tail.each_line do |line| - ilog.error(line) + if event.diagnostics.nil? + ilog.error('Lifecycle event chain is not available.') + else + ilog.error(event.diagnostics.message) + event.diagnostics.log_tail.each_line do |line| + ilog.error(line) + end end end end