handle cleanup errors
parent
4debf00dd9
commit
0bcb7d9cd8
|
|
@ -586,7 +586,12 @@ class AWS {
|
||||||
cluster,
|
cluster,
|
||||||
}).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode;
|
}).promise()).tasks) === null || _r === void 0 ? void 0 : _r[0].containers) === null || _s === void 0 ? void 0 : _s[0].exitCode;
|
||||||
if (exitCode !== 0) {
|
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}`);
|
core.error(`job failed with exit code ${exitCode}`);
|
||||||
throw new Error(`job failed with exit code ${exitCode}`);
|
throw new Error(`job failed with exit code ${exitCode}`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -458,7 +458,12 @@ class AWS {
|
||||||
}).promise()
|
}).promise()
|
||||||
).tasks?.[0].containers?.[0].exitCode;
|
).tasks?.[0].containers?.[0].exitCode;
|
||||||
if (exitCode !== 0) {
|
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}`);
|
core.error(`job failed with exit code ${exitCode}`);
|
||||||
throw new Error(`job failed with exit code ${exitCode}`);
|
throw new Error(`job failed with exit code ${exitCode}`);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue