@@ -56578,6 +56578,9 @@ const main = async () => {
5657856578 return;
5657956579 }
5658056580
56581+ // Get CWLogsClient
56582+ let CWLogClient = new CloudWatchLogsClient();
56583+
5658156584 // Only create logFilterStream if tailLogs is enabled, and we wait for the task to stop in the pipeline
5658256585 if (tailLogs) {
5658356586 core.debug(`Logging enabled. Getting logConfiguration from TaskDefinition.`)
@@ -56612,7 +56615,6 @@ const main = async () => {
5661256615
5661356616 // Start Live Tail
5661456617 try {
56615- const CWLogClient = new CloudWatchLogsClient();
5661656618 const response = await CWLogClient.send(new StartLiveTailCommand({
5661756619 logGroupIdentifiers: [logGroupIdentifier],
5661856620 logStreamNames: [logStreamName]
@@ -56645,6 +56647,7 @@ const main = async () => {
5664556647 }
5664656648
5664756649 // Close LogStream and store output
56650+ CWLogClient.destroy();
5664856651 core.setOutput('log-output', logOutput);
5664956652
5665056653 // Describe Task to get Exit Code and Exceptions
@@ -56684,7 +56687,15 @@ async function handleCWResponseAsync(response) {
5668456687 core.error("CWLiveTailSession error: Unknown event type.");
5668556688 }
5668656689 } catch (err) {
56687- core.error(err.message)
56690+ // If we close the connection, we will get an error with message 'aborted' which we can ignore as it will
56691+ // just show as an error in the logs.
56692+ if (err.message === 'aborted') {
56693+ core.debug("CWLiveTailSession aborted.");
56694+
56695+ return;
56696+ }
56697+
56698+ core.error(err.name + ": " + err.message);
5668856699 }
5668956700}
5669056701
0 commit comments