fix(aws): error handling wrap try/catch to avoid unhandled promise rejections.
parent
12fed08300
commit
db96d97c8d
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -133,6 +133,7 @@ export class TaskService {
|
||||||
public static async awsDescribeJob(job: string) {
|
public static async awsDescribeJob(job: string) {
|
||||||
process.env.AWS_REGION = Input.region;
|
process.env.AWS_REGION = Input.region;
|
||||||
const CF = new CloudFormation({ region: Input.region });
|
const CF = new CloudFormation({ region: Input.region });
|
||||||
|
try {
|
||||||
const stack =
|
const stack =
|
||||||
(await CF.send(new ListStacksCommand({}))).StackSummaries?.find((_x) => _x.StackName === job) || undefined;
|
(await CF.send(new ListStacksCommand({}))).StackSummaries?.find((_x) => _x.StackName === job) || undefined;
|
||||||
const stackInfo = (await CF.send(new DescribeStackResourcesCommand({ StackName: job }))) || undefined;
|
const stackInfo = (await CF.send(new DescribeStackResourcesCommand({ StackName: job }))) || undefined;
|
||||||
|
|
@ -154,6 +155,12 @@ export class TaskService {
|
||||||
CloudRunnerLogger.log(message);
|
CloudRunnerLogger.log(message);
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
|
} catch (error) {
|
||||||
|
CloudRunnerLogger.error(
|
||||||
|
`Failed to describe job ${job}: ${error instanceof Error ? error.message : String(error)}`,
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static async getLogGroups() {
|
public static async getLogGroups() {
|
||||||
const result: Array<LogGroup> = [];
|
const result: Array<LogGroup> = [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue