Always describe AWS tasks for now, because unstable error handling
							parent
							
								
									3d538c6395
								
							
						
					
					
						commit
						d838bef87c
					
				|  | @ -1393,8 +1393,9 @@ class AWSTaskRunner { | |||
|             const output = yield this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName); | ||||
|             const exitCode = (_q = (yield AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers) === null || _q === void 0 ? void 0 : _q[0].exitCode; | ||||
|             cloud_runner_logger_1.default.log(`Cloud runner job exit code ${exitCode}`); | ||||
|             cloud_runner_logger_1.default.log(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), undefined, 4)}`); | ||||
|             if (exitCode !== 0 && exitCode !== undefined) { | ||||
|                 core.error(`job failed with exit code ${exitCode} ${JSON.stringify(yield ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), undefined, 4)}`); | ||||
|                 core.error(`job failed with exit code ${exitCode} "exitCode !== 0 && exitCode !== undefined"`); | ||||
|                 throw new Error(`job failed with exit code ${exitCode}`); | ||||
|             } | ||||
|             else { | ||||
|  |  | |||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -75,14 +75,15 @@ class AWSTaskRunner { | |||
|     const output = await this.streamLogsUntilTaskStops(ECS, CF, taskDef, cluster, taskArn, streamName); | ||||
|     const exitCode = (await AWSTaskRunner.describeTasks(ECS, cluster, taskArn)).containers?.[0].exitCode; | ||||
|     CloudRunnerLogger.log(`Cloud runner job exit code ${exitCode}`); | ||||
|     CloudRunnerLogger.log( | ||||
|       `job failed with exit code ${exitCode} ${JSON.stringify( | ||||
|         await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), | ||||
|         undefined, | ||||
|         4, | ||||
|       )}`,
 | ||||
|     ); | ||||
|     if (exitCode !== 0 && exitCode !== undefined) { | ||||
|       core.error( | ||||
|         `job failed with exit code ${exitCode} ${JSON.stringify( | ||||
|           await ECS.describeTasks({ tasks: [taskArn], cluster }).promise(), | ||||
|           undefined, | ||||
|           4, | ||||
|         )}`,
 | ||||
|       ); | ||||
|       core.error(`job failed with exit code ${exitCode} "exitCode !== 0 && exitCode !== undefined"`); | ||||
|       throw new Error(`job failed with exit code ${exitCode}`); | ||||
|     } else { | ||||
|       CloudRunnerLogger.log(`Cloud runner job has finished successfully`); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue