handle cleanup errors

pull/235/head
mdugdale 2021-04-03 20:44:20 +01:00
parent 4debf00dd9
commit 0bcb7d9cd8
3 changed files with 13 additions and 3 deletions

7
dist/index.js vendored
View File

@ -586,7 +586,12 @@ class AWS {
cluster,
}).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode;
if (exitCode !== 0) {
yield this.cleanupResources(CF, taskDef);
try {
yield this.cleanupResources(CF, taskDef);
}
catch (error) {
core.warning(`failed to cleanup ${error}`);
}
core.error(`job failed with exit code ${exitCode}`);
throw new Error(`job failed with exit code ${exitCode}`);
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -458,7 +458,12 @@ class AWS {
}).promise()
).tasks?.[0].containers?.[0].exitCode;
if (exitCode !== 0) {
await this.cleanupResources(CF, taskDef);
try {
await this.cleanupResources(CF, taskDef);
}
catch (error) {
core.warning(`failed to cleanup ${error}`);
}
core.error(`job failed with exit code ${exitCode}`);
throw new Error(`job failed with exit code ${exitCode}`);
} else {